aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-08-13 07:40:38 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-08-13 15:14:07 +0200
commit5268bd2900effa59b51e0fede61aacde5e2f0b95 (patch)
tree31204ed3fc0b7ced1c03ee4e84d868fb59064959
parent3562684db716d11de0b0dcc52748e9cd90d68132 (diff)
downloadffmpeg-5268bd2900effa59b51e0fede61aacde5e2f0b95.tar.gz
segafilm: Error out on impossible packet size
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
-rw-r--r--libavformat/segafilm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c
index 068d432083..adf24759c6 100644
--- a/libavformat/segafilm.c
+++ b/libavformat/segafilm.c
@@ -214,6 +214,8 @@ static int film_read_header(AVFormatContext *s)
film->sample_table[i].sample_offset =
data_offset + AV_RB32(&scratch[0]);
film->sample_table[i].sample_size = AV_RB32(&scratch[4]);
+ if (film->sample_table[i].sample_size > INT_MAX / 4)
+ return AVERROR_INVALIDDATA;
if (AV_RB32(&scratch[8]) == 0xFFFFFFFF) {
film->sample_table[i].stream = film->audio_stream_index;
film->sample_table[i].pts = audio_frame_counter;