[FFmpeg-cvslog] Check NUV per-frame header for validity.

Reimar Döffinger git at videolan.org
Sat Nov 5 23:54:35 CET 2011


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Sat Nov  5 23:13:07 2011 +0100| [6f3ebcc320d87e60f738f6cd3ff322c1716c3a93] | committer: Reimar Döffinger

Check NUV per-frame header for validity.

Since it contains dimensions parsing an invalid one has rather
annoying effects.

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

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

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

diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index d8b9dbf..b94f5af 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -184,8 +184,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     }
     if (c->codec_frameheader) {
         int w, h, q;
-        if (buf_size < 12) {
-            av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame\n");
+        if (buf[0] != 'V' || buf_size < 12) {
+            av_log(avctx, AV_LOG_ERROR, "invalid nuv video frame (wrong codec_tag?)\n");
             return -1;
         }
         w = AV_RL16(&buf[6]);



More information about the ffmpeg-cvslog mailing list