aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-11-10 22:14:39 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-11-26 01:35:45 +0100
commitdf31acda644a83818f4be465c927329ddd9a9816 (patch)
tree50e73613f3ffc2ce3df5ca75d412bcefbda8c987
parentd09fd0736a43b7a7df0873ca0ed99fbce9dc97ff (diff)
downloadffmpeg-df31acda644a83818f4be465c927329ddd9a9816.tar.gz
dvdsubdec: validate offset2 similar to offset1
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> (cherry picked from commit f621749d1181987b3f815c6766ea66d6c5d55198) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavcodec/dvdsubdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 7120f10a53..f009824401 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -346,7 +346,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;