[FFmpeg-devel] [PATCH 5/6] avformat/iff: Check that we have a stream in read_dst_frame()

Peter Ross pross at xvid.org
Sun Feb 9 09:16:22 EET 2025


On Sun, Feb 09, 2025 at 03:24:20AM +0100, Michael Niedermayer wrote:
> Fixes: null pointer dereference
> Fixes: 385644864/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-4551049565765632
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavformat/iff.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavformat/iff.c b/libavformat/iff.c
> index 38f90dd81cb..7142a06e98f 100644
> --- a/libavformat/iff.c
> +++ b/libavformat/iff.c
> @@ -364,6 +364,9 @@ static int read_dst_frame(AVFormatContext *s, AVPacket *pkt)
>      uint64_t chunk_pos, data_pos, data_size;
>      int ret = AVERROR_EOF;
>  
> +    if (s->nb_streams < 1)
> +        return AVERROR_INVALIDDATA;
> +
>      while (!avio_feof(pb)) {
>          chunk_pos = avio_tell(pb);
>          if (chunk_pos >= iff->body_end)
> -- 
> 2.48.1

please apply, thanks.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250209/c1f115d8/attachment.sig>


More information about the ffmpeg-devel mailing list