[FFmpeg-cvslog] nuv: check buffer size before checking content.

Michael Niedermayer git at videolan.org
Tue Apr 17 20:28:40 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Apr 17 19:32:04 2012 +0200| [ebf6d1d295debe112b990bea772f26a0441af079] | committer: Michael Niedermayer

nuv: check buffer size before checking content.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/nuv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index 4bc236d..bb236d1 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -191,7 +191,7 @@ retry:
     }
     if (c->codec_frameheader) {
         int w, h, q, res;
-        if (buf[0] != 'V' || buf_size < 12) {
+        if (buf_size < 12 || buf[0] != 'V') {
             av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame (wrong codec_tag?)\n");
             return AVERROR_INVALIDDATA;
         }



More information about the ffmpeg-cvslog mailing list