diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-14 23:25:39 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-15 10:04:52 +0200 |
commit | ab8f686bbc8ac682417ad275ae3c35245283ef0f (patch) | |
tree | 16d5c02b0d0c47e01bb2155275a7aeaae178469a | |
parent | b5a942685fee5417f02dd68510f433e9d7115acd (diff) | |
download | ffmpeg-ab8f686bbc8ac682417ad275ae3c35245283ef0f.tar.gz |
avcodec/dvbsubdec: Clear w/h/size on region buffer allocation failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9f0b898e8258a9a51b290f4c145388d62080f868)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/dvbsubdec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index 46abb6a6ad..384604949f 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1197,8 +1197,12 @@ static int dvbsub_parse_region_segment(AVCodecContext *avctx, region->buf_size = region->width * region->height; region->pbuf = av_malloc(region->buf_size); - if (!region->pbuf) + if (!region->pbuf) { + region->buf_size = + region->width = + region->height = 0; return AVERROR(ENOMEM); + } fill = 1; region->dirty = 0; |