summaryrefslogtreecommitdiff
path: root/libavcodec/dvdsubdec.c
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-11 00:39:47 +0100
commitf621749d1181987b3f815c6766ea66d6c5d55198 (patch)
treeb424fd5c00f9f17ff01db150ea4356cc92670191 /libavcodec/dvdsubdec.c
parent91053990602de8da4df911692710f0e8362daac9 (diff)
downloadffmpeg-f621749d1181987b3f815c6766ea66d6c5d55198.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>
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-rw-r--r--libavcodec/dvdsubdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index ee06d55117..014b0a3a83 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;