[FFmpeg-devel] libavformat/demux.c: MythTV added NULL checks

Scott Theisen scott.the.elm at gmail.com
Sat Nov 30 00:31:06 EET 2024


On 11/28/24 10:07, Anton Khirnov wrote:
> Quoting Scott Theisen (2024-11-14 06:52:05)
>> I don't know if any of these are still necessary since I have reduced MythTV's
>> modifications to FFmpeg and replaced all uses of internal functions.
> All of these look quite suspicious to me - the flow should never get
> there with the relevant pointer being NULL.
>
> If you have a way of actually triggering any of these, I'd like to see
> it.
>

Looking at the changes again, I agree that these patches are unnecessary 
and can be ignored:

update_initial_timestamps(): the AVStream* will already have been 
dereferenced
higher up the call stack.

compute_frame_duration(): AVStream::codecpar should always be non-NULL, see
avformat_new_stream(), and the AVStream* will already have been dereferenced
higher up the call stack.

handle_new_packet(): av_assert0() guarantees that the AVStream* is valid 
if they
have been added and removed from the AVFormatContext correctly.

Regards,

Scott Theisen


More information about the ffmpeg-devel mailing list