[FFmpeg-cvslog] nuv: check size of buffer before accessing it instead of after.

Reimar Döffinger git at videolan.org
Wed Aug 1 19:37:34 CEST 2012


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Tue Jul 31 20:32:38 2012 +0200| [e1bc0171c0e6ba85cc14a52b979d6cb00b0c38bb] | committer: Reimar Döffinger

nuv: check size of buffer before accessing it instead of after.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

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

 libavcodec/nuv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index bb236d1..17fcb70 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -164,7 +164,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         return orig_size;
     }
 
-    if (buf[0] != 'V' || buf_size < 12) {
+    if (buf_size < 12 || buf[0] != 'V') {
         av_log(avctx, AV_LOG_ERROR, "not a nuv video frame\n");
         return -1;
     }



More information about the ffmpeg-cvslog mailing list