[FFmpeg-devel] [PATCH 1/1] [ffmpeg-deve] avcodec/mpegaudiodec optimizing code size
Michael Niedermayer
michael at niedermayer.cc
Wed May 21 10:40:57 EEST 2025
On Wed, May 21, 2025 at 02:46:42AM +0200, Michael Niedermayer wrote:
> On Mon, May 19, 2025 at 08:15:37PM +0800, chenyu202107 at gmail.com wrote:
> > From: chenyu <chenyu202107 at gmail.com>
> >
> > Optimizing 160k code size by converting static array to dynamic malloc memory.
> >
> > Signed-off-by: chenyu <chenyu202107 at gmail.com>
> > ---
> > libavcodec/mpegaudiodata.h | 4 ++--
> > libavcodec/mpegaudiodec_common_tablegen.h | 10 ++++++++--
> > 2 files changed, 10 insertions(+), 4 deletions(-)
>
> This segfaults:
>
> ./ffmpeg_g -max_error_rate 2 -max_alloc 100000 -i ~/tickets/2950/mpeg2_fuzz.mpg -max_muxing_queue_size 8000 -f null -
==3638361== Invalid write of size 4
==3638361== at 0x2DFB01: mpegaudiodec_common_init_static (in ffmpeg/ffmpeg_g)
==3638361== by 0x4A114DE: __pthread_once_slow (pthread_once.c:116)
==3638361== by 0x2DFBB1: ff_mpegaudiodec_common_init_static (in ffmpeg/ffmpeg_g)
==3638361== by 0x4A114DE: __pthread_once_slow (pthread_once.c:116)
==3638361== by 0x2A6FFD: decode_init (in ffmpeg/ffmpeg_g)
==3638361== by 0x7E4BF1: avcodec_open2 (in ffmpeg/ffmpeg_g)
==3638361== by 0x62C444: try_decode_frame (in ffmpeg/ffmpeg_g)
==3638361== by 0x631575: avformat_find_stream_info (in ffmpeg/ffmpeg_g)
==3638361== by 0x306596: ifile_open (in ffmpeg/ffmpeg_g)
==3638361== by 0x31CA17: open_files.isra.0 (in ffmpeg/ffmpeg_g)
==3638361== by 0x31E9F5: ffmpeg_parse_options (in ffmpeg/ffmpeg_g)
==3638361== by 0x2FD297: main (in ffmpeg/ffmpeg_g)
==3638361== Address 0x4 is not stack'd, malloc'd or (recently) free'd
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
For a strong democracy, genuine criticism is necessary, allegations benefit
noone, they just cause unnecessary conflicts. - Narendra Modi
-------------- 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/20250521/2743fc7e/attachment.sig>
More information about the ffmpeg-devel
mailing list