[FFmpeg-cvslog] avcodec/dvbsubdec: Clear w/h/size on region buffer allocation failure

Michael Niedermayer git at videolan.org
Fri May 15 00:55:00 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu May 14 23:25:39 2015 +0200| [9f0b898e8258a9a51b290f4c145388d62080f868] | committer: Michael Niedermayer

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

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f0b898e8258a9a51b290f4c145388d62080f868
---

 libavcodec/dvbsubdec.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 8c2a0ea..7c3dedf 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -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;



More information about the ffmpeg-cvslog mailing list