[FFmpeg-devel] [PATCH 16/19] sp5xdec: sanitize return value.

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


i is the decoded size of a recoded packet, which is larger
than the original packet. Assume that if decoding succeeded,
all the packet was used.

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

diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c
index 04ddf09..d3efa65 100644
--- a/libavcodec/sp5xdec.c
+++ b/libavcodec/sp5xdec.c
@@ -90,7 +90,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx,
 
     av_free(recoded);
 
-    return i;
+    return i < 0 ? i : avpkt->size;
 }
 
 #if CONFIG_SP5X_DECODER
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list