[FFmpeg-cvslog] sp5xdec: sanitize return value.

Nicolas George git at videolan.org
Tue Jul 31 17:35:57 CEST 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Sat Jul 28 23:52:50 2012 +0200| [b2814b034ee287691a133f11a7443516549f572f] | committer: Nicolas George

sp5xdec: sanitize return value.

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2814b034ee287691a133f11a7443516549f572f
---

 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



More information about the ffmpeg-cvslog mailing list