diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-26 13:09:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-10-08 13:15:42 +0200 |
commit | 97340bdfa3913f991960060a18824ea7df4fc081 (patch) | |
tree | 4da81f8f9073fe875013bec3bb2bfe87daa434bb | |
parent | 61fd5a3072470e4b0ea2dd938f520f4c18a01ddc (diff) | |
download | ffmpeg-97340bdfa3913f991960060a18824ea7df4fc081.tar.gz |
avcodec/ffv1dec: Explicitly check read_quant_table() return value
Forwards the error code, avoids potential integer overflow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 10bbf6cf622f8a954c6cc694ca07c24f989c99af)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/ffv1dec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index e68f3d207d..93d728a2a5 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -502,7 +502,10 @@ static int read_quant_tables(RangeCoder *c, int context_count = 1; for (i = 0; i < 5; i++) { - context_count *= read_quant_table(c, quant_table[i], context_count); + int ret = read_quant_table(c, quant_table[i], context_count); + if (ret < 0) + return ret; + context_count *= ret; if (context_count > 32768U) { return AVERROR_INVALIDDATA; } |