[FFmpeg-devel] [PATCH] dvdsubdec: validate offset2 similar to offset1

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Tue Nov 10 23:30:05 CET 2015


If it is negative, it causes segmentation faults in decode_rle.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
---
 libavcodec/dvdsubdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index ee06d55..014b0a3 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -353,7 +353,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
             }
         }
     the_end:
-        if (offset1 >= 0) {
+        if (offset1 >= 0 && offset2 >= 0) {
             int w, h;
             uint8_t *bitmap;
 
-- 
2.6.2


More information about the ffmpeg-devel mailing list