Browse Source

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>
tags/n2.6
Michael Niedermayer 10 years ago
parent
commit
df6cdb23f0
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/utils.c

+ 2
- 0
libavcodec/utils.c View File

@@ -2090,6 +2090,8 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,


if (frame && frame->format == AV_PIX_FMT_NONE) if (frame && frame->format == AV_PIX_FMT_NONE)
av_log(avctx, AV_LOG_WARNING, "AVFrame.format is not set\n"); 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); av_assert0(avctx->codec->encode2);




Loading…
Cancel
Save