diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-07 22:57:02 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-07 22:58:13 +0100 |
commit | 419ade4b6193c6eb626cda01b21e7091f42b2cc2 (patch) | |
tree | b2c1803fe3f34e8d9bba73125faaf0415357debd | |
parent | 320ae9fb784f898331d21de225178a1fca0a7849 (diff) | |
download | ffmpeg-419ade4b6193c6eb626cda01b21e7091f42b2cc2.tar.gz |
lavc: check dimensions for video encoders
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/utils.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index d042afa3c9..3d33f85d97 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1000,6 +1000,13 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code } else if (avctx->channel_layout) { avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout); } + if(avctx->codec_type == AVMEDIA_TYPE_VIDEO) { + if (avctx->width <= 0 || avctx->height <= 0) { + av_log(avctx, AV_LOG_ERROR, "dimensions not set\n"); + ret = AVERROR(EINVAL); + goto free_and_end; + } + } } avctx->pts_correction_num_faulty_pts = |