Commit 9bcc4304 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '088eca28'

* commit '088eca28':
  avresample: prevent theoretical division by zero
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 733db64c 088eca28
......@@ -585,9 +585,12 @@ static inline int convert_frame(AVAudioResampleContext *avr,
static inline int available_samples(AVFrame *out)
{
int samples;
int bytes_per_sample = av_get_bytes_per_sample(out->format);
int samples = out->linesize[0] / bytes_per_sample;
if (!bytes_per_sample)
return AVERROR(EINVAL);
samples = out->linesize[0] / bytes_per_sample;
if (av_sample_fmt_is_planar(out->format)) {
return samples;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment