[FFmpeg-cvslog] avcodec/dvbsubdec: Fix buf_size check in dvbsub_parse_display_definition_segment()

banastasov git at videolan.org
Sat May 30 04:39:04 CEST 2015


ffmpeg | branch: master | banastasov <btanastasov at yahoo.co.uk> | Sat May 30 04:28:39 2015 +0200| [debf4d6e67dfb29f3d71683add429c588828f8e8] | committer: Michael Niedermayer

avcodec/dvbsubdec: Fix buf_size check in dvbsub_parse_display_definition_segment()

Fixes Ticket4326

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

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

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

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 7c3dedf..e268e2a 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1504,10 +1504,10 @@ static int dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
         avctx->height = display_def->height;
     }
 
-    if (buf_size < 13)
-        return AVERROR_INVALIDDATA;
-
     if (info_byte & 1<<3) { // display_window_flag
+        if (buf_size < 13)
+            return AVERROR_INVALIDDATA;
+
         display_def->x = bytestream_get_be16(&buf);
         display_def->width  = bytestream_get_be16(&buf) - display_def->x + 1;
         display_def->y = bytestream_get_be16(&buf);



More information about the ffmpeg-cvslog mailing list