summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2015-09-26 13:09:59 +0200
committerMichael Niedermayer <[email protected]>2015-11-19 03:51:38 +0100
commit17bbabc141a1ed72ada3598b91df8446c9a2ef45 (patch)
tree8724d438b5dd7769436dae3e4630deb8dd4bace0
parente77ad4b06954f7958942b42f8163dc1d9fdabebf (diff)
avcodec/ffv1dec: Explicitly check read_quant_table() return value
Forwards the error code, avoids potential integer overflow Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 10bbf6cf622f8a954c6cc694ca07c24f989c99af) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/ffv1dec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index f89776d301..61915057df 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -503,7 +503,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;
}