Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-08 01:57:02 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-12-08 01:58:13 +0400
commit419ade4b6193c6eb626cda01b21e7091f42b2cc2 (patch)
treeb2c1803fe3f34e8d9bba73125faaf0415357debd
parent320ae9fb784f898331d21de225178a1fca0a7849 (diff)
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 =