diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-17 10:24:47 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-28 14:40:52 -0400 |
commit | 8c9581f052d3724f7ccb893b1e79d5f06f5425d7 (patch) | |
tree | da97ca6dbecbffa68b2cb26d411f013230e63d24 /libavcodec/nellymoserdec.c | |
parent | 0aaa85dbedbd4029dac0e78f10a412c7ec9a0d4d (diff) | |
download | ffmpeg-8c9581f052d3724f7ccb893b1e79d5f06f5425d7.tar.gz |
nellymoserdec: do not fail if there is extra data in the packet
instead just print a warning
Diffstat (limited to 'libavcodec/nellymoserdec.c')
-rw-r--r-- | libavcodec/nellymoserdec.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index 3812d78b11..53538d0c6b 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -170,11 +170,6 @@ static int decode_tag(AVCodecContext * avctx, int16_t *samples_s16 = data; float *samples_flt = data; - if (buf_size % NELLY_BLOCK_LEN) { - av_log(avctx, AV_LOG_ERROR, "Tag size %d.\n", buf_size); - *data_size = 0; - return buf_size; - } block_size = NELLY_SAMPLES * av_get_bytes_per_sample(avctx->sample_fmt); blocks = buf_size / NELLY_BLOCK_LEN; if (blocks <= 0) { @@ -185,6 +180,10 @@ static int decode_tag(AVCodecContext * avctx, av_log(avctx, AV_LOG_ERROR, "Output buffer is too small\n"); return AVERROR(EINVAL); } + if (buf_size % NELLY_BLOCK_LEN) { + av_log(avctx, AV_LOG_WARNING, "Leftover bytes: %d.\n", + buf_size % NELLY_BLOCK_LEN); + } /* Normal numbers of blocks for sample rates: * 8000 Hz - 1 * 11025 Hz - 2 |