diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-01 02:46:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-01 02:46:56 +0200 |
commit | 211dcdca5cd98173b76ea219a119c412b6ba8635 (patch) | |
tree | e1962225ecef547c477b9aab07e28448ca884f9f /libavcodec/xsubdec.c | |
parent | 1dc58965fd0f430c6020622842ff174feb352a7f (diff) | |
parent | 522d971c7f5921bebcea2fc50e67056afdabb951 (diff) | |
download | ffmpeg-211dcdca5cd98173b76ea219a119c412b6ba8635.tar.gz |
Merge commit '522d971c7f5921bebcea2fc50e67056afdabb951'
* commit '522d971c7f5921bebcea2fc50e67056afdabb951':
xsub: Check memory allocation
Conflicts:
libavcodec/xsubdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/xsubdec.c')
-rw-r--r-- | libavcodec/xsubdec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index 1bb90e2b9d..2db263ba29 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -109,10 +109,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, sub->rects[0]->nb_colors = 4; sub->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE); if (!sub->rects[0]->pict.data[0] || !sub->rects[0]->pict.data[1]) { + av_freep(&sub->rects[0]->pict.data[1]); + av_freep(&sub->rects[0]->pict.data[0]); av_freep(&sub->rects[0]); av_freep(&sub->rects); return AVERROR(ENOMEM); - } sub->num_rects = 1; |