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:37:56 +0100
commitb6a4abc7705f3bfea14f468ed5d45fcd88873be5 (patch)
tree66de3ce47e400f063fc0732ca132ee020a6d085c
parent8beb5d17f1e135bdf14ceea4a59e2c00360e8c33 (diff)
downloadffmpeg-b6a4abc7705f3bfea14f468ed5d45fcd88873be5.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 222c71bdcf..62c9348668 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;