Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

-Wstringop-overflow warning from gcc-14

Open
#119 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
15/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c

Research direction

The warning points at minimp3.h:695/697 inside L3_decode_scalefactors, inlined from L3_decode (1245) and mp3dec_decode_frame (1773), where iscf[40] is declared at line 662. First reproduce: compile a translation unit that includes minimp3.h with gcc-14 at the same optimisation level (the SDL_mixer build is a starting point) and check the reported offsets (up to 296) against the 40-byte buffer. Then trace how gr->n_long_sfb and i bound that index. Done means a decision backed by evidence: an index bound, or an explanation in the issue that the warning is a false positive.

Written by the indexing model from the issue text.

Description

In SDL_mixer, we are getting a -Wstringop-overflow warning from gcc-14:
https://github.com/libsdl-org/SDL_mixer/issues/616

In file included from /tmp/SDL_mixer/src/codecs/minimp3/minimp3_ex.h:10,
                 from /tmp/SDL_mixer/src/codecs/music_minimp3.c:29:
In function 'L3_decode_scalefactors',
    inlined from 'L3_decode' at /tmp/SDL_mixer/src/codecs/minimp3/minimp3.h:1245:9,
    inlined from 'mp3dec_decode_frame' at /tmp/SDL_mixer/src/codecs/minimp3/minimp3.h:1773:17:
/home/ozzie/2/SDL_mixer/src/codecs/minimp3/minimp3.h:695:42: warning: writing 2 bytes into a region of size 1 [-Wstringop-overflow=]
  695 |             iscf[gr->n_long_sfb + i + 0] += gr->subblock_gain[0] << sh;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SDL_mixer/src/codecs/minimp3/minimp3.h: In function 'mp3dec_decode_frame':
/tmp/SDL_mixer/src/codecs/minimp3/minimp3.h:662:26: note: at offset [39, 40] into destination object 'iscf' of size 40
  662 |     uint8_t scf_size[4], iscf[40];
      |                          ^~~~
In function 'L3_decode_scalefactors',
    inlined from 'L3_decode' at /tmp/SDL_mixer/src/codecs/minimp3/minimp3.h:1245:9,
    inlined from 'mp3dec_decode_frame' at /tmp/SDL_mixer/src/codecs/minimp3/minimp3.h:1773:17:
/tmp/SDL_mixer/src/codecs/minimp3/minimp3.h:697:42: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  697 |             iscf[gr->n_long_sfb + i + 2] += gr->subblock_gain[2] << sh;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/SDL_mixer/src/codecs/minimp3/minimp3.h: In function 'mp3dec_decode_frame':
/tmp/SDL_mixer/src/codecs/minimp3/minimp3.h:662:26: note: at offset [41, 296] into destination object 'iscf' of size 40
  662 |     uint8_t scf_size[4], iscf[40];
      |                          ^~~~

Is it bogus, or should we take it seriously?

Dominant language
C
Stars
2k
Forks
271
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lieff/minimp3

All issues in lieff/minimp3

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.