summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-07 17:23:54 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-07 17:47:44 +0100
commitdf6cdb23f00baf6b88cff69ca8734233225a77e6 (patch)
tree23ae929ca817462403ef5278098a4829cf7ec58a /libavcodec/utils.c
parent0ae37e460c345a4c76e28256af56931e00c94cb5 (diff)
avcodec/utils: Check AVFrame width/height in avcodec_encode_video2()
This is similar to the format check Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a75fe1a80e..db79b67e93 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2090,6 +2090,8 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
if (frame && frame->format == AV_PIX_FMT_NONE)
av_log(avctx, AV_LOG_WARNING, "AVFrame.format is not set\n");
+ if (frame && (frame->width == 0 || frame->height == 0))
+ av_log(avctx, AV_LOG_WARNING, "AVFrame.width or height is not set\n");
av_assert0(avctx->codec->encode2);