for(i = 0; i <= stereo; i++)
*samples++ = pred[i];
for(; i < unp_size / 2; i++) {
- if(get_bits_left(&gb)<0)
- return AVERROR_INVALIDDATA;
+ if (get_bits_left(&gb) < 0) {
+ ret = AVERROR_INVALIDDATA;
+ goto error;
+ }
if(i & stereo) {
if(vlc[2].table)
res = get_vlc2(&gb, vlc[2].table, SMKTREE_BITS, 3);
res = 0;
if (res < 0) {
av_log(avctx, AV_LOG_ERROR, "invalid vlc\n");
- return AVERROR_INVALIDDATA;
+ ret = AVERROR_INVALIDDATA;
+ goto error;
}
val = h[2].values[res];
if(vlc[3].table)
res = 0;
if (res < 0) {
av_log(avctx, AV_LOG_ERROR, "invalid vlc\n");
- return AVERROR_INVALIDDATA;
+ ret = AVERROR_INVALIDDATA;
+ goto error;
}
val |= h[3].values[res] << 8;
pred[1] += sign_extend(val, 16);
res = 0;
if (res < 0) {
av_log(avctx, AV_LOG_ERROR, "invalid vlc\n");
- return AVERROR_INVALIDDATA;
+ ret = AVERROR_INVALIDDATA;
+ goto error;
}
val = h[0].values[res];
if(vlc[1].table)
res = 0;
if (res < 0) {
av_log(avctx, AV_LOG_ERROR, "invalid vlc\n");
- return AVERROR_INVALIDDATA;
+ ret = AVERROR_INVALIDDATA;
+ goto error;
}
val |= h[1].values[res] << 8;
pred[0] += sign_extend(val, 16);
for(i = 0; i <= stereo; i++)
*samples8++ = pred[i];
for(; i < unp_size; i++) {
- if(get_bits_left(&gb)<0)
- return AVERROR_INVALIDDATA;
+ if (get_bits_left(&gb) < 0) {
+ ret = AVERROR_INVALIDDATA;
+ goto error;
+ }
if(i & stereo){
if(vlc[1].table)
res = get_vlc2(&gb, vlc[1].table, SMKTREE_BITS, 3);
res = 0;
if (res < 0) {
av_log(avctx, AV_LOG_ERROR, "invalid vlc\n");
- return AVERROR_INVALIDDATA;
+ ret = AVERROR_INVALIDDATA;
+ goto error;
}
pred[1] += sign_extend(h[1].values[res], 8);
*samples8++ = pred[1];
res = 0;
if (res < 0) {
av_log(avctx, AV_LOG_ERROR, "invalid vlc\n");
- return AVERROR_INVALIDDATA;
+ ret = AVERROR_INVALIDDATA;
+ goto error;
}
pred[0] += sign_extend(h[0].values[res], 8);
*samples8++ = pred[0];