avformat/rtpdec: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
bb858e67e5
commit
f7f4a90174
@ -666,8 +666,8 @@ void ff_rtp_reset_packet_queue(RTPDemuxContext *s)
|
|||||||
{
|
{
|
||||||
while (s->queue) {
|
while (s->queue) {
|
||||||
RTPPacket *next = s->queue->next;
|
RTPPacket *next = s->queue->next;
|
||||||
av_free(s->queue->buf);
|
av_freep(&s->queue->buf);
|
||||||
av_free(s->queue);
|
av_freep(&s->queue);
|
||||||
s->queue = next;
|
s->queue = next;
|
||||||
}
|
}
|
||||||
s->seq = 0;
|
s->seq = 0;
|
||||||
@ -725,8 +725,8 @@ static int rtp_parse_queued_packet(RTPDemuxContext *s, AVPacket *pkt)
|
|||||||
/* Parse the first packet in the queue, and dequeue it */
|
/* Parse the first packet in the queue, and dequeue it */
|
||||||
rv = rtp_parse_packet_internal(s, pkt, s->queue->buf, s->queue->len);
|
rv = rtp_parse_packet_internal(s, pkt, s->queue->buf, s->queue->len);
|
||||||
next = s->queue->next;
|
next = s->queue->next;
|
||||||
av_free(s->queue->buf);
|
av_freep(&s->queue->buf);
|
||||||
av_free(s->queue);
|
av_freep(&s->queue);
|
||||||
s->queue = next;
|
s->queue = next;
|
||||||
s->queue_len--;
|
s->queue_len--;
|
||||||
return rv;
|
return rv;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user