mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 17:32:06 +00:00
avfilter_get_video_buffer_ref_from_frame: check channel count
more than 8 channels is not supported and crashes with null pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
0ceca269b6
commit
5a4eb6aa27
@ -92,8 +92,12 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame
|
||||
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
|
||||
int perms)
|
||||
{
|
||||
AVFilterBufferRef *samplesref =
|
||||
avfilter_get_audio_buffer_ref_from_arrays((uint8_t **)frame->data, frame->linesize[0], perms,
|
||||
AVFilterBufferRef *samplesref;
|
||||
|
||||
if(av_frame_get_channels(frame) > 8) // libavfilter does not suport more than 8 channels FIXME, remove once libavfilter is fixed
|
||||
return NULL;
|
||||
|
||||
samplesref = avfilter_get_audio_buffer_ref_from_arrays((uint8_t **)frame->data, frame->linesize[0], perms,
|
||||
frame->nb_samples, frame->format,
|
||||
av_frame_get_channel_layout(frame));
|
||||
if (!samplesref)
|
||||
|
Loading…
Reference in New Issue
Block a user