Hi,

The mov/avif muxer duplicates extradata delivered mid stream via
AV_PKT_DATA_NEW_EXTRADATA with av_memdup(), which allocates exactly
sd->size bytes. mov_write_av1c_tag() then parses that buffer with a
bitreader, and FFmpeg bitreaders read in 32 bit units and require
AV_INPUT_BUFFER_PADDING_SIZE trailing bytes, so the parse reads past
the end of the allocation.

Found by fuzzing the muxers under ASan: heap-buffer-overflow, READ of
size 4, in parse_obu_header() via ff_isom_write_av1c(), for an AV1
stream written through the avif/image2 path. The values decoded from
out of bounds memory are written into the av1C box.

mov_write_header() already copies extradata the padded way, so only the
av_memdup() copies are affected.

Patch attached. fate-lavf-mov, fate-lavf-mp4, fate-lavf-ismv and
fate-lavf-nut pass unchanged.

Thanks,
Sanil

Attachment: EMAIL-1-movenc.patch
Description: Binary data

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to