diff options
author | banastasov <btanastasov@yahoo.co.uk> | 2015-05-30 04:28:39 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2015-06-19 10:32:20 +0200 |
commit | df408d213ad1cd0723aa67191071aa371ba5443b (patch) | |
tree | 02a79b6315740b61e727dee5134d436614a57e83 | |
parent | 7e5a298bce178f6c1f760b0e4c41d46ccb8583e8 (diff) | |
download | ffmpeg-df408d213ad1cd0723aa67191071aa371ba5443b.tar.gz |
avcodec/dvbsubdec: Fix buf_size check in dvbsub_parse_display_definition_segment()
Fixes Ticket4326
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit debf4d6e67dfb29f3d71683add429c588828f8e8)
-rw-r--r-- | libavcodec/dvbsubdec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index 384604949f..a1b8cea938 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1503,10 +1503,10 @@ static int dvbsub_parse_display_definition_segment(AVCodecContext *avctx, avctx->height = display_def->height; } - if (buf_size < 13) - return AVERROR_INVALIDDATA; - if (info_byte & 1<<3) { // display_window_flag + if (buf_size < 13) + return AVERROR_INVALIDDATA; + display_def->x = bytestream_get_be16(&buf); display_def->width = bytestream_get_be16(&buf) - display_def->x + 1; display_def->y = bytestream_get_be16(&buf); |