[FFmpeg-cvslog] avcodec/utils: Check AVFrame width/height in avcodec_encode_video2()

Michael Niedermayer git at videolan.org
Sun Dec 7 17:48:38 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Dec  7 17:23:54 2014 +0100| [df6cdb23f00baf6b88cff69ca8734233225a77e6] | committer: Michael Niedermayer

avcodec/utils: Check AVFrame width/height in avcodec_encode_video2()

This is similar to the format check

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a75fe1a..db79b67 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);
 



More information about the ffmpeg-cvslog mailing list