Browse Source

avcodec/cavsdec: use more specific error codes

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 11 years ago
parent
commit
bc1b828536
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/cavsdec.c

+ 2
- 2
libavcodec/cavsdec.c View File

@@ -566,7 +566,7 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
if (level_code >= ESCAPE_CODE) { if (level_code >= ESCAPE_CODE) {
run = ((level_code - ESCAPE_CODE) >> 1) + 1; run = ((level_code - ESCAPE_CODE) >> 1) + 1;
if(run > 64) if(run > 64)
return -1;
return AVERROR_INVALIDDATA;
esc_code = get_ue_code(gb, esc_golomb_order); esc_code = get_ue_code(gb, esc_golomb_order);
level = esc_code + (run > r->max_run ? 1 : r->level_add[run]); level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
while (level > r->inc_limit) while (level > r->inc_limit)
@@ -893,7 +893,7 @@ static inline int decode_slice_header(AVSContext *h, GetBitContext *gb)
av_log(h->avctx, AV_LOG_ERROR, "unexpected start code 0x%02x\n", h->stc); 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)
return -1;
return AVERROR_INVALIDDATA;


h->mby = h->stc; h->mby = h->stc;
h->mbidx = h->mby * h->mb_width; h->mbidx = h->mby * h->mb_width;


Loading…
Cancel
Save