aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
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 /libavcodec/utils.c
parent320ae9fb784f898331d21de225178a1fca0a7849 (diff)
downloadandroid_external_ffmpeg-419ade4b6193c6eb626cda01b21e7091f42b2cc2.tar.gz
android_external_ffmpeg-419ade4b6193c6eb626cda01b21e7091f42b2cc2.tar.bz2
android_external_ffmpeg-419ade4b6193c6eb626cda01b21e7091f42b2cc2.zip
lavc: check dimensions for video encoders
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-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 =