aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-05 03:53:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-05 03:53:39 +0100
commitbe99054e77f1a0380d3597406d042f8e8e52b315 (patch)
tree27098d528e9bb3840905ad9033772fd717c73323 /libavcodec
parentbc1b828536cd0524e6ac6284d9aa2d41ee077b97 (diff)
downloadffmpeg-be99054e77f1a0380d3597406d042f8e8e52b315.tar.gz
avcodec/cavsdec: print error messages in case of errors
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/cavsdec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index ff726bbb02..44d0ec0f9c 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -565,8 +565,10 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
level_code = get_ue_code(gb, r->golomb_order);
if (level_code >= ESCAPE_CODE) {
run = ((level_code - ESCAPE_CODE) >> 1) + 1;
- if(run > 64)
+ if(run > 64) {
+ av_log(h->avctx, AV_LOG_ERROR, "run %d is too large\n", run);
return AVERROR_INVALIDDATA;
+ }
esc_code = get_ue_code(gb, esc_golomb_order);
level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
while (level > r->inc_limit)
@@ -892,8 +894,10 @@ static inline int decode_slice_header(AVSContext *h, GetBitContext *gb)
if (h->stc > 0xAF)
av_log(h->avctx, AV_LOG_ERROR, "unexpected start code 0x%02x\n", h->stc);
- if (h->stc >= h->mb_height)
+ if (h->stc >= h->mb_height) {
+ av_log(h->avctx, AV_LOG_ERROR, "stc 0x%02x is too large\n", h->stc);
return AVERROR_INVALIDDATA;
+ }
h->mby = h->stc;
h->mbidx = h->mby * h->mb_width;