aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-26 13:09:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-12 02:55:46 +0100
commit54661cf0b2c9b0218e419b7cc3fd095a59762cda (patch)
treef33a00dd064338bfcb3c6b178ba53b5bc5cdd213
parent50f62fef19f159ad2729f530b12901b6f4cba3a8 (diff)
downloadffmpeg-54661cf0b2c9b0218e419b7cc3fd095a59762cda.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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 85de676300..d828aaf3ef 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;
}