mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-21 23:10:13 +00:00
nuv: validate image size
Avoid a division by zero. CC: libav-stable@libav.org Bug-Id: CID 717750
This commit is contained in:
parent
7c51d79ca7
commit
e71149a7a5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user