Skip to content
Snippets Groups Projects
Commit 419ade4b authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

lavc: check dimensions for video encoders

parent 320ae9fb
No related branches found
No related tags found
No related merge requests found
...@@ -1000,6 +1000,13 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code ...@@ -1000,6 +1000,13 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
} else if (avctx->channel_layout) { } else if (avctx->channel_layout) {
avctx->channels = av_get_channel_layout_nb_channels(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 = avctx->pts_correction_num_faulty_pts =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment