Commit 8e6a44cf authored by Michael Niedermayer's avatar Michael Niedermayer

avdevice/iec61883: Use av_freep(), avoid leaving stale pointers in memory

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 90c9b494
...@@ -219,8 +219,8 @@ static int iec61883_parse_queue_hdv(struct iec61883_data *dv, AVPacket *pkt) ...@@ -219,8 +219,8 @@ static int iec61883_parse_queue_hdv(struct iec61883_data *dv, AVPacket *pkt)
size = avpriv_mpegts_parse_packet(dv->mpeg_demux, pkt, packet->buf, size = avpriv_mpegts_parse_packet(dv->mpeg_demux, pkt, packet->buf,
packet->len); packet->len);
dv->queue_first = packet->next; dv->queue_first = packet->next;
av_free(packet->buf); av_freep(&packet->buf);
av_free(packet); av_freep(&packet);
dv->packets--; dv->packets--;
if (size > 0) if (size > 0)
...@@ -455,8 +455,8 @@ static int iec61883_close(AVFormatContext *context) ...@@ -455,8 +455,8 @@ static int iec61883_close(AVFormatContext *context)
while (dv->queue_first) { while (dv->queue_first) {
DVPacket *packet = dv->queue_first; DVPacket *packet = dv->queue_first;
dv->queue_first = packet->next; dv->queue_first = packet->next;
av_free(packet->buf); av_freep(&packet->buf);
av_free(packet); av_freep(&packet);
} }
iec61883_cmp_disconnect(dv->raw1394, dv->node, dv->output_port, iec61883_cmp_disconnect(dv->raw1394, dv->node, dv->output_port,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment