From ebf6d1d295debe112b990bea772f26a0441af079 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 17 Apr 2012 19:32:04 +0200 Subject: [PATCH] nuv: check buffer size before checking content. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/nuv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 4bc236dce2..bb236d1edf 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; }