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

Nicolas George nicolas.george at normalesup.org
Sun Jul 29 15:57:26 CEST 2012


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavcodec/wmalosslessdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index dabd093..3ee9ee8 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -1180,7 +1180,7 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
 
         /* sanity check for the buffer length */
         if (buf_size < avctx->block_align)
-            return 0;
+            return buf_size ? AVERROR_INVALIDDATA : 0;
 
         s->next_packet_start = buf_size - avctx->block_align;
         buf_size             = avctx->block_align;
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list