aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-01-23 15:03:09 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-01-27 15:26:37 +0000
commite71149a7a5b10ed7baa5a06f47d0313c7bd8df52 (patch)
tree2c7c9058ef1e1702dbc7aea6e477078166b10070
parent7c51d79ca7badfb370c410b8f44c9142b938e2e6 (diff)
downloadffmpeg-e71149a7a5b10ed7baa5a06f47d0313c7bd8df52.tar.gz
nuv: validate image size
Avoid a division by zero. CC: libav-stable@libav.org Bug-Id: CID 717750
-rw-r--r--libavformat/nuv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index 9336912fe0..586aec65f6 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;