avcodec/mpegvideo_enc: check that max_b_frames is not negative
Fixes crash found by saste Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
6103faaa51
commit
ce55e667fa
@ -452,6 +452,11 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
|
|||||||
av_log(avctx, AV_LOG_ERROR, "b frames not supported by codec\n");
|
av_log(avctx, AV_LOG_ERROR, "b frames not supported by codec\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (s->max_b_frames < 0) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
|
"max b frames must be 0 or postive for mpegvideo based encoders\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if ((s->codec_id == AV_CODEC_ID_MPEG4 ||
|
if ((s->codec_id == AV_CODEC_ID_MPEG4 ||
|
||||||
s->codec_id == AV_CODEC_ID_H263 ||
|
s->codec_id == AV_CODEC_ID_H263 ||
|
||||||
|
Loading…
Reference in New Issue
Block a user