nellymoserdec: do not fail if there is extra data in the packet
instead just print a warning
This commit is contained in:
parent
0aaa85dbed
commit
8c9581f052
@ -170,11 +170,6 @@ static int decode_tag(AVCodecContext * avctx,
|
|||||||
int16_t *samples_s16 = data;
|
int16_t *samples_s16 = data;
|
||||||
float *samples_flt = 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);
|
block_size = NELLY_SAMPLES * av_get_bytes_per_sample(avctx->sample_fmt);
|
||||||
blocks = buf_size / NELLY_BLOCK_LEN;
|
blocks = buf_size / NELLY_BLOCK_LEN;
|
||||||
if (blocks <= 0) {
|
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");
|
av_log(avctx, AV_LOG_ERROR, "Output buffer is too small\n");
|
||||||
return AVERROR(EINVAL);
|
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:
|
/* Normal numbers of blocks for sample rates:
|
||||||
* 8000 Hz - 1
|
* 8000 Hz - 1
|
||||||
* 11025 Hz - 2
|
* 11025 Hz - 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user