[FFmpeg-devel] [PATCH 07/19] wmaprodec: fix return value for too small packets.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jul 29 17:35:54 CEST 2012


On Sun, Jul 29, 2012 at 03:57:25PM +0200, Nicolas George wrote:
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavcodec/wmaprodec.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
> index b60a257..8ba9685 100644
> --- a/libavcodec/wmaprodec.c
> +++ b/libavcodec/wmaprodec.c
> @@ -1512,7 +1512,7 @@ static int decode_packet(AVCodecContext *avctx, void *data,
>  
>          /** sanity check for the buffer length */
>          if (buf_size < avctx->block_align)
> -            return 0;
> +            return buf_size ? AVERROR_INVALIDDATA : 0;

I don't really think empty packets should be considered valid for WMA.


More information about the ffmpeg-devel mailing list