mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 00:32:31 +00:00
avutil/samplefmt: don't add offsets to NULL pointers
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
7916c14713
commit
8a6103326e
@ -160,13 +160,20 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
|
||||
if (buf_size < 0)
|
||||
return buf_size;
|
||||
|
||||
if (linesize)
|
||||
*linesize = line_size;
|
||||
|
||||
memset(audio_data, 0, planar
|
||||
? sizeof(*audio_data) * nb_channels
|
||||
: sizeof(*audio_data));
|
||||
|
||||
if (!buf)
|
||||
return buf_size;
|
||||
|
||||
audio_data[0] = (uint8_t *)buf;
|
||||
for (ch = 1; planar && ch < nb_channels; ch++)
|
||||
audio_data[ch] = audio_data[ch-1] + line_size;
|
||||
|
||||
if (linesize)
|
||||
*linesize = line_size;
|
||||
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user