Browse Source

avcodec/utils: Fix overflow in get_bit_rates computations

Fixes: 129ca3e28d73af7b1e24a9d4118e7a2d/signal_sigabrt_7ffff6ae7cc9_836_762b310fc3ef6087bd7771e5d8e90b9b.asf

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.0
Michael Niedermayer 9 years ago
parent
commit
15d14ce47c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/utils.c

+ 1
- 1
libavcodec/utils.c View File

@@ -1141,7 +1141,7 @@ static int64_t get_bit_rate(AVCodecContext *ctx)
break; break;
case AVMEDIA_TYPE_AUDIO: case AVMEDIA_TYPE_AUDIO:
bits_per_sample = av_get_bits_per_sample(ctx->codec_id); bits_per_sample = av_get_bits_per_sample(ctx->codec_id);
bit_rate = bits_per_sample ? ctx->sample_rate * ctx->channels * bits_per_sample : ctx->bit_rate;
bit_rate = bits_per_sample ? ctx->sample_rate * (int64_t)ctx->channels * bits_per_sample : ctx->bit_rate;
break; break;
default: default:
bit_rate = 0; bit_rate = 0;


Loading…
Cancel
Save