[FFmpeg-cvslog] avcodec/dvbsubdec: use av_freep() for saftey
Michael Niedermayer
git at videolan.org
Tue Nov 11 22:28:40 CET 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Nov 11 22:20:20 2014 +0100| [2813dabdd4964ab37f8b0cea42f49531931c9006] | committer: Michael Niedermayer
avcodec/dvbsubdec: use av_freep() for saftey
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2813dabdd4964ab37f8b0cea42f49531931c9006
---
libavcodec/dvbsubdec.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index c45d568..b1f953e 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -842,15 +842,15 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou
rect->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
if (!rect->pict.data[1]) {
- av_free(sub->rects);
+ av_freep(&sub->rects);
return AVERROR(ENOMEM);
}
memcpy(rect->pict.data[1], clut_table, (1 << region->depth) * sizeof(uint32_t));
rect->pict.data[0] = av_malloc(region->buf_size);
if (!rect->pict.data[0]) {
- av_free(rect->pict.data[1]);
- av_free(sub->rects);
+ av_freep(&rect->pict.data[1]);
+ av_freep(&sub->rects);
return AVERROR(ENOMEM);
}
More information about the ffmpeg-cvslog
mailing list