aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qdm2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-08 23:09:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-08 23:34:53 +0200
commit66337bf9d58af031a91ef05ecc6ec97b644c9c58 (patch)
tree2e5586106ce1f933ba315f1d85c4413e89107bbb /libavcodec/qdm2.c
parentbadb0c07d4b9cec5b041200e585bdc2b25f7d05b (diff)
downloadffmpeg-66337bf9d58af031a91ef05ecc6ec97b644c9c58.tar.gz
qdm2: print error messages instead of just retunring failures
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/qdm2.c')
-rw-r--r--libavcodec/qdm2.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index a71de72d5b..7a5d0726f9 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -888,8 +888,10 @@ static int synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int le
case 30:
if (get_bits_left(gb) >= 4) {
unsigned index = qdm2_get_vlc(gb, &vlc_tab_type30, 0, 1);
- if (index >= FF_ARRAY_ELEMS(type30_dequant))
+ if (index >= FF_ARRAY_ELEMS(type30_dequant)) {
+ av_log(NULL, AV_LOG_ERROR, "index %d out of type30_dequant array\n", index);
return AVERROR_INVALIDDATA;
+ }
samples[0] = type30_dequant[index];
} else
samples[0] = SB_DITHERING_NOISE(sb,q->noise_idx);
@@ -906,8 +908,10 @@ static int synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int le
type34_first = 0;
} else {
unsigned index = qdm2_get_vlc(gb, &vlc_tab_type34, 0, 1);
- if (index >= FF_ARRAY_ELEMS(type34_delta))
+ if (index >= FF_ARRAY_ELEMS(type34_delta)) {
+ av_log(NULL, AV_LOG_ERROR, "index %d out of type34_delta array\n", index);
return AVERROR_INVALIDDATA;
+ }
samples[0] = type34_delta[index] / type34_div + type34_predictor;
type34_predictor = samples[0];
}
@@ -1834,8 +1838,10 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
avctx->channels = s->nb_channels = s->channels = AV_RB32(extradata);
extradata += 4;
- if (s->channels > MPA_MAX_CHANNELS)
+ if (s->channels > MPA_MAX_CHANNELS) {
+ av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
return AVERROR_INVALIDDATA;
+ }
avctx->sample_rate = AV_RB32(extradata);
extradata += 4;