ffmpeg | branch: master | Michael Niedermayer <michae...@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 <michae...@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;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to