1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avcodec/mpegvideo: change bit_rate to 64bit

32bit is not sufficient for all cases

Fixes: signal_sigabrt_7ffff6ac8cc9_686_cov_1897408623_microsoft_new_way_to_shove_mpeg2_in_asf.dvr_ms

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-09-02 21:02:31 +02:00
parent 5b6a50e150
commit d9b56895b5
6 changed files with 9 additions and 9 deletions

View File

@ -1506,7 +1506,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
if (s->avctx->debug & FF_DEBUG_PICT_INFO) if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_DEBUG, av_log(s->avctx, AV_LOG_DEBUG,
"profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%d\n", "profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%"PRId64"\n",
s->avctx->profile, s->avctx->level, s->progressive_sequence, s->chroma_format, s->avctx->profile, s->avctx->level, s->progressive_sequence, s->chroma_format,
s->avctx->rc_buffer_size, s->bit_rate); s->avctx->rc_buffer_size, s->bit_rate);
} }
@ -2228,7 +2228,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
s->low_delay = 1; s->low_delay = 1;
if (s->avctx->debug & FF_DEBUG_PICT_INFO) if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%d, aspect_ratio_info: %d \n", av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%"PRId64", aspect_ratio_info: %d \n",
s->avctx->rc_buffer_size, s->bit_rate, s->aspect_ratio_info); s->avctx->rc_buffer_size, s->bit_rate, s->aspect_ratio_info);
return 0; return 0;

View File

@ -107,7 +107,7 @@ typedef struct MpegEncContext {
int width, height;///< picture size. must be a multiple of 16 int width, height;///< picture size. must be a multiple of 16
int gop_size; int gop_size;
int intra_only; ///< if true, only intra pictures are generated int intra_only; ///< if true, only intra pictures are generated
int bit_rate; ///< wanted bit rate int64_t bit_rate; ///< wanted bit rate
enum OutputFormat out_format; ///< output format enum OutputFormat out_format; ///< output format
int h263_pred; ///< use mpeg4/h263 ac/dc predictions int h263_pred; ///< use mpeg4/h263 ac/dc predictions
int pb_frame; ///< PB frame mode (0 = none, 1 = base, 2 = improved) int pb_frame; ///< PB frame mode (0 = none, 1 = base, 2 = improved)

View File

@ -541,7 +541,7 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s)
s->no_rounding = 0; s->no_rounding = 0;
} }
} }
ff_dlog(s->avctx, "%d %d %d %d %d\n", s->pict_type, s->bit_rate, ff_dlog(s->avctx, "%d %"PRId64" %d %d %d\n", s->pict_type, s->bit_rate,
s->inter_intra_pred, s->width, s->height); s->inter_intra_pred, s->width, s->height);
s->esc3_level_length= 0; s->esc3_level_length= 0;

View File

@ -240,7 +240,7 @@ void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
s->per_mb_rl_table = 0; s->per_mb_rl_table = 0;
if(s->msmpeg4_version==4) if(s->msmpeg4_version==4)
s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE && s->pict_type==AV_PICTURE_TYPE_P); s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE && s->pict_type==AV_PICTURE_TYPE_P);
ff_dlog(s, "%d %d %d %d %d\n", s->pict_type, s->bit_rate, ff_dlog(s, "%d %"PRId64" %d %d %d\n", s->pict_type, s->bit_rate,
s->inter_intra_pred, s->width, s->height); s->inter_intra_pred, s->width, s->height);
if (s->pict_type == AV_PICTURE_TYPE_I) { if (s->pict_type == AV_PICTURE_TYPE_I) {

View File

@ -890,7 +890,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
if (s->avctx->debug & FF_DEBUG_RC) { if (s->avctx->debug & FF_DEBUG_RC) {
av_log(s->avctx, AV_LOG_DEBUG, av_log(s->avctx, AV_LOG_DEBUG,
"%c qp:%d<%2.1f<%d %d want:%d total:%d comp:%f st_q:%2.2f " "%c qp:%d<%2.1f<%d %d want:%d total:%d comp:%f st_q:%2.2f "
"size:%d var:%"PRId64"/%"PRId64" br:%d fps:%d\n", "size:%d var:%"PRId64"/%"PRId64" br:%"PRId64" fps:%d\n",
av_get_picture_type_char(pict_type), av_get_picture_type_char(pict_type),
qmin, q, qmax, picture_number, qmin, q, qmax, picture_number,
(int)wanted_bits / 1000, (int)s->total_bits / 1000, (int)wanted_bits / 1000, (int)s->total_bits / 1000,
@ -1057,9 +1057,9 @@ static int init_pass2(MpegEncContext *s)
} }
av_assert0(toobig <= 40); av_assert0(toobig <= 40);
av_log(s->avctx, AV_LOG_DEBUG, av_log(s->avctx, AV_LOG_DEBUG,
"[lavc rc] requested bitrate: %d bps expected bitrate: %d bps\n", "[lavc rc] requested bitrate: %"PRId64" bps expected bitrate: %"PRId64" bps\n",
s->bit_rate, s->bit_rate,
(int)(expected_bits / ((double)all_available_bits / s->bit_rate))); (int64_t)(expected_bits / ((double)all_available_bits / s->bit_rate)));
av_log(s->avctx, AV_LOG_DEBUG, av_log(s->avctx, AV_LOG_DEBUG,
"[lavc rc] estimated target average qp: %.3f\n", "[lavc rc] estimated target average qp: %.3f\n",
(float)qscale_sum / rcc->num_entries); (float)qscale_sum / rcc->num_entries);

View File

@ -108,7 +108,7 @@ static int decode_ext_header(Wmv2Context *w)
if (s->avctx->debug & FF_DEBUG_PICT_INFO) if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_DEBUG, av_log(s->avctx, AV_LOG_DEBUG,
"fps:%d, br:%d, qpbit:%d, abt_flag:%d, j_type_bit:%d, " "fps:%d, br:%"PRId64", qpbit:%d, abt_flag:%d, j_type_bit:%d, "
"tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, " "tl_mv_flag:%d, mbrl_bit:%d, code:%d, loop_filter:%d, "
"slices:%d\n", "slices:%d\n",
fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit, fps, s->bit_rate, w->mspel_bit, w->abt_flag, w->j_type_bit,