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

Nicolas George nicolas.george at normalesup.org
Tue Jul 31 18:34:44 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..90bcd56 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 AVERROR_INVALIDDATA;
 
         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