mirror of
https://github.com/librempeg/librempeg
synced 2024-11-23 19:58:59 +00:00
avcodec/wma: Return specific error code
This way, the calling function can just forward it instead of making it up. Signed-off-by: Olivier Crête <olivier.crete@collabora.com>
This commit is contained in:
parent
c1c7f2b61f
commit
521388edb7
@ -459,7 +459,7 @@ int ff_wma_run_level_decode(AVCodecContext *avctx, GetBitContext *gb,
|
|||||||
if (get_bits1(gb)) {
|
if (get_bits1(gb)) {
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"broken escape sequence\n");
|
"broken escape sequence\n");
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
} else
|
} else
|
||||||
offset += get_bits(gb, frame_len_bits) + 4;
|
offset += get_bits(gb, frame_len_bits) + 4;
|
||||||
} else
|
} else
|
||||||
@ -477,7 +477,7 @@ int ff_wma_run_level_decode(AVCodecContext *avctx, GetBitContext *gb,
|
|||||||
offset,
|
offset,
|
||||||
num_coefs
|
num_coefs
|
||||||
);
|
);
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -991,13 +991,16 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c)
|
|||||||
|
|
||||||
/** decode run level coded coefficients */
|
/** decode run level coded coefficients */
|
||||||
if (cur_coeff < s->subframe_len) {
|
if (cur_coeff < s->subframe_len) {
|
||||||
|
int ret;
|
||||||
|
|
||||||
memset(&ci->coeffs[cur_coeff], 0,
|
memset(&ci->coeffs[cur_coeff], 0,
|
||||||
sizeof(*ci->coeffs) * (s->subframe_len - cur_coeff));
|
sizeof(*ci->coeffs) * (s->subframe_len - cur_coeff));
|
||||||
if (ff_wma_run_level_decode(s->avctx, &s->gb, vlc,
|
ret = ff_wma_run_level_decode(s->avctx, &s->gb, vlc,
|
||||||
level, run, 1, ci->coeffs,
|
level, run, 1, ci->coeffs,
|
||||||
cur_coeff, s->subframe_len,
|
cur_coeff, s->subframe_len,
|
||||||
s->subframe_len, s->esc_len, 0))
|
s->subframe_len, s->esc_len, 0);
|
||||||
return AVERROR_INVALIDDATA;
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user