You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/iff: Use unsigned to avoid compiler warning
GCC 12 apparently believes that negative palette sizes are possible (they are not, as this has already been checked during init) and therefore emits a -Wstringop-overflow= for the memcpy. Using unsigned avoids this. (To be honest, there might be a compiler bug involved.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -151,9 +151,10 @@ static av_always_inline uint32_t gray2rgb(const uint32_t x) {
|
|||||||
static int cmap_read_palette(AVCodecContext *avctx, uint32_t *pal)
|
static int cmap_read_palette(AVCodecContext *avctx, uint32_t *pal)
|
||||||
{
|
{
|
||||||
IffContext *s = avctx->priv_data;
|
IffContext *s = avctx->priv_data;
|
||||||
int count, i;
|
unsigned count, i;
|
||||||
const uint8_t *const palette = avctx->extradata + AV_RB16(avctx->extradata);
|
const uint8_t *const palette = avctx->extradata + AV_RB16(avctx->extradata);
|
||||||
int palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
|
/* extract_header() already checked that the RHS is >= 0. */
|
||||||
|
unsigned palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
|
||||||
|
|
||||||
if (avctx->bits_per_coded_sample > 8) {
|
if (avctx->bits_per_coded_sample > 8) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "bits_per_coded_sample > 8 not supported\n");
|
av_log(avctx, AV_LOG_ERROR, "bits_per_coded_sample > 8 not supported\n");
|
||||||
|
Reference in New Issue
Block a user