]> git.sesse.net Git - ffmpeg/commitdiff
dvdsubdec: validate offset2 similar to offset1
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Tue, 10 Nov 2015 21:14:39 +0000 (22:14 +0100)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Tue, 10 Nov 2015 23:39:47 +0000 (00:39 +0100)
If it is negative, it causes segmentation faults in decode_rle.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
libavcodec/dvdsubdec.c

index ee06d55117fd955637eaa2263f9226dd13031af7..014b0a3a8341d2804912847e3ca10327a566b06e 100644 (file)
@@ -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;