[FFmpeg-devel] [PATCH 09/16] vmdaudio: set *data_size to zero when skipping small packets and add a warning log message.
Kostya
kostya.shishkov
Tue Feb 22 22:52:35 CET 2011
On Tue, Feb 22, 2011 at 02:05:28PM -0500, Justin Ruggles wrote:
> ---
> libavcodec/vmdav.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
> index da1852a..4ee46c8 100644
> --- a/libavcodec/vmdav.c
> +++ b/libavcodec/vmdav.c
> @@ -511,8 +511,11 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx,
> /* point to the start of the encoded data */
> const unsigned char *p = buf + 16;
>
> - if (buf_size < 16)
> + if (buf_size < 16) {
> + av_log(avctx, AV_LOG_WARNING, "skipping small audio packet\n");
> + *data_size = 0;
> return buf_size;
> + }
>
> block_type = buf[6];
> if (block_type < BLOCK_TYPE_AUDIO || block_type > BLOCK_TYPE_SILENCE) {
demuxer prepends chunk data header to demuxed packet and its length exactly
16 bytes, so it's not skipping small audio packet, it's ignoring junk
More information about the ffmpeg-devel
mailing list