Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-26 14:09:59 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-26 14:42:04 +0300
commit10bbf6cf622f8a954c6cc694ca07c24f989c99af (patch)
tree045cf25a26c66b00e850b6008252c5289635a434 /libavcodec/ffv1dec.c
parent7a4b97e946f5a1fdf9839c11db3331381bb8643c (diff)
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>
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r--libavcodec/ffv1dec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 6ab6a96c3f..2a1fc0d9d6 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;
}