avcodec/dvbsubdec: Clear w/h/size on region buffer allocation failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-05-14 23:25:39 +02:00
parent 8f1afde11d
commit 9f0b898e82

View File

@ -1198,8 +1198,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;