diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-17 03:11:45 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-17 20:07:50 +0100 |
commit | af5004b557562dd767844c4aacc2c189dba05eef (patch) | |
tree | df5c386435d1825ee6948eaa78f0d60cdcb2cc36 /libavcodec | |
parent | 24860a913cfe44285ab2a5a53dd04d755ea00cca (diff) | |
download | ffmpeg-af5004b557562dd767844c4aacc2c189dba05eef.tar.gz |
lavc: use av_freep() for freeing extended_data
This is safer
Reviewed-by: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 7ea9c54f31..22a7ee3666 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -296,7 +296,7 @@ int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, buf, nb_channels, frame->nb_samples, sample_fmt, align)) < 0) { if (frame->extended_data != frame->data) - av_free(frame->extended_data); + av_freep(&frame->extended_data); return ret; } if (frame->extended_data != frame->data) { @@ -334,7 +334,7 @@ static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame) if (buf->extended_data[0] && buf_size > buf->audio_data_size) { av_free(buf->extended_data[0]); if (buf->extended_data != buf->data) - av_free(&buf->extended_data); + av_freep(&buf->extended_data); buf->extended_data = NULL; buf->data[0] = NULL; } @@ -1110,7 +1110,7 @@ int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx, } if (frame && frame->extended_data != frame->data) - av_free(frame->extended_data); + av_freep(&frame->extended_data); return ret ? ret : pkt.size; } @@ -1733,7 +1733,7 @@ static void audio_free_buffers(AVCodecContext *avctx) if (buf->extended_data) { av_free(buf->extended_data[0]); if (buf->extended_data != buf->data) - av_free(buf->extended_data); + av_freep(&buf->extended_data); } av_freep(&avci->buffer); } |