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 <michaelni@gmx.at>2015-05-14 02:01:35 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-05-14 02:01:35 +0300
commit22f15f5735389e992ec9aed43b0680e75746b3a1 (patch)
treee74663c8e49e122a3dea1f44db5f60a467941d96 /libavcodec/on2avc.c
parent93cfa7d1692c25cff045f99ba1af2c9e5772c45e (diff)
avcodec/on2avc: Check run more carefully
Fixes CID1239106 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/on2avc.c')
-rw-r--r--libavcodec/on2avc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c
index 4a38da00e5..1d8fcbc596 100644
--- a/libavcodec/on2avc.c
+++ b/libavcodec/on2avc.c
@@ -119,12 +119,12 @@ static int on2avc_decode_band_types(On2AVCContext *c, GetBitContext *gb)
run_len = 1;
do {
run = get_bits(gb, bits_per_sect);
+ if (run > num_bands - band - run_len) {
+ av_log(c->avctx, AV_LOG_ERROR, "Invalid band type run\n");
+ return AVERROR_INVALIDDATA;
+ }
run_len += run;
} while (run == esc_val);
- if (band + run_len > num_bands) {
- av_log(c->avctx, AV_LOG_ERROR, "Invalid band type run\n");
- return AVERROR_INVALIDDATA;
- }
for (i = band; i < band + run_len; i++) {
c->band_type[i] = band_type;
c->band_run_end[i] = band + run_len;