[FFmpeg-trac] #11589(avcodec:new): null check for AVSideDataDescriptor* in ffmpeg_enc.c
FFmpeg
trac at avcodec.org
Thu May 15 12:39:20 EEST 2025
#11589: null check for AVSideDataDescriptor* in ffmpeg_enc.c
-------------------------------------+----------------------------------
Reporter: uttam_32472 | Type: defect
Status: new | Priority: normal
Component: avcodec | Version: 7.1
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+----------------------------------
ffmpeg_enc.c is accessing the struct member without null check.
const AVSideDataDescriptor *desc =
av_frame_side_data_desc(frame->side_data[i]->type);
if (!(desc->props & AV_SIDE_DATA_PROP_GLOBAL))
https://github.com/FFmpeg/FFmpeg/blob/4991c1ec92874737a9c4b1bce1b3f73a23b78b20/fftools/ffmpeg_enc.c#L191
Above code can crash if the given sidedata type entry is not present in
https://github.com/FFmpeg/FFmpeg/blob/4991c1ec92874737a9c4b1bce1b3f73a23b78b20/libavutil/frame.c#L31C1-L61C3
There are null checks present in https://github.com/Xilinx-
Projects/ma35_ffmpeg/blob/develop/src/libavutil/frame.c for the return
value of av_frame_side_data_desc() and same should be with ffmpeg_enc.c as
well.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11589>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list