Commit bb858e67 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/rtpdec_latm: Use av_freep() to avoid leaving stale pointers in memory

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ba8d2c90
...@@ -45,7 +45,7 @@ static void latm_free_context(PayloadContext *data) ...@@ -45,7 +45,7 @@ static void latm_free_context(PayloadContext *data)
avio_close_dyn_buf(data->dyn_buf, &p); avio_close_dyn_buf(data->dyn_buf, &p);
av_free(p); av_free(p);
} }
av_free(data->buf); av_freep(&data->buf);
av_free(data); av_free(data);
} }
...@@ -72,7 +72,7 @@ static int latm_parse_packet(AVFormatContext *ctx, PayloadContext *data, ...@@ -72,7 +72,7 @@ static int latm_parse_packet(AVFormatContext *ctx, PayloadContext *data,
if (!(flags & RTP_FLAG_MARKER)) if (!(flags & RTP_FLAG_MARKER))
return AVERROR(EAGAIN); return AVERROR(EAGAIN);
av_free(data->buf); av_freep(&data->buf);
data->len = avio_close_dyn_buf(data->dyn_buf, &data->buf); data->len = avio_close_dyn_buf(data->dyn_buf, &data->buf);
data->dyn_buf = NULL; data->dyn_buf = NULL;
data->pos = 0; data->pos = 0;
......
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