[FFmpeg-cvslog] nuv: validate image size

Vittorio Giovara git at videolan.org
Tue Jan 27 20:19:28 CET 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Fri Jan 23 15:03:09 2015 +0000| [e71149a7a5b10ed7baa5a06f47d0313c7bd8df52] | committer: Vittorio Giovara

nuv: validate image size

Avoid a division by zero.

CC: libav-stable at libav.org
Bug-Id: CID 717750

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

 libavformat/nuv.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index 9336912..586aec6 100644
--- a/libavformat/nuv.c
+++ b/libavformat/nuv.c
@@ -20,6 +20,7 @@
  */
 
 #include "libavutil/channel_layout.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/intfloat.h"
 #include "avformat.h"
@@ -188,6 +189,10 @@ static int nuv_header(AVFormatContext *s)
             return AVERROR(ENOMEM);
         ctx->v_id = vst->index;
 
+        ret = av_image_check_size(width, height, 0, ctx);
+        if (ret < 0)
+            return ret;
+
         vst->codec->codec_type            = AVMEDIA_TYPE_VIDEO;
         vst->codec->codec_id              = AV_CODEC_ID_NUV;
         vst->codec->width                 = width;



More information about the ffmpeg-cvslog mailing list