mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
Merge commit '088eca28164c8cd3b72b0c3d3f9e3fe5ee5cb28f'
* commit '088eca28164c8cd3b72b0c3d3f9e3fe5ee5cb28f': avresample: prevent theoretical division by zero Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
9bcc430481
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user