mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avcodec/mpegvideo_enc: check intra dc precission
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
97f86cd976
commit
339d8fb353
@ -342,6 +342,17 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
|
||||
} else if (s->intra_dc_precision >= 8)
|
||||
s->intra_dc_precision -= 8;
|
||||
|
||||
if (s->intra_dc_precision < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"intra dc precision must be positive, note some applications use"
|
||||
" 0 and some 8 as base meaning 8bit, the value must not be smaller than that\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (s->intra_dc_precision > (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO ? 3 : 0)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "intra dc precision too large\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
s->user_specified_pts = AV_NOPTS_VALUE;
|
||||
|
||||
if (s->gop_size <= 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user