aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-07 22:57:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-07 22:58:13 +0100
commit419ade4b6193c6eb626cda01b21e7091f42b2cc2 (patch)
treeb2c1803fe3f34e8d9bba73125faaf0415357debd
parent320ae9fb784f898331d21de225178a1fca0a7849 (diff)
downloadffmpeg-419ade4b6193c6eb626cda01b21e7091f42b2cc2.tar.gz
lavc: check dimensions for video encoders
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/utils.c7
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 =