[FFmpeg-devel] [PATCH 1/5] avformat/mov: Check that sample_count is allocated in mov_parse_heif_items()

James Almer jamrial at gmail.com
Mon Jun 23 17:43:04 EEST 2025


On 6/21/2025 6:15 PM, Michael Niedermayer wrote:
> Fixes: NULL pointer dereference
> Fixes: 416811958/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5425269114732544
> 
> 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/mov.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 8a094b1ea0a..6e9e3498fb5 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -10336,7 +10336,7 @@ static int mov_parse_heif_items(AVFormatContext *s)
>           st->codecpar->height = item->height;
>   
>           err = sanity_checks(s, sc, item->item_id);
> -        if (err)
> +        if (err || !sc->sample_count)
>               return AVERROR_INVALIDDATA;
>   
>           sc->sample_sizes[0]  = item->extent_length;

LGTM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250623/8a8fdeaa/attachment.sig>


More information about the ffmpeg-devel mailing list