1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/indeo3: Fix UB pointer arithmetic

Fixes the following error when running with Clang-UBSan:
src/libavcodec/indeo3.c:556:26: runtime error: applying non-zero offset 2560 to null pointer
This fixes the indeo3-2 FATE test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-06-22 22:36:00 +02:00
parent 11d1b71c31
commit 7574c55761

View File

@ -691,9 +691,11 @@ static int decode_cell(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
} }
zoom_fac = mode == 10; zoom_fac = mode == 10;
error = decode_cell_data(ctx, cell, block, ref_block, plane->pitch, av_assert2(!ref_block);
zoom_fac, 1, mode, delta, swap_quads, error = decode_cell_data(ctx, cell, block,
&data_ptr, last_ptr); block /* dummy to avoid UB pointer arithmetic */,
plane->pitch, zoom_fac, 1, mode, delta,
swap_quads, &data_ptr, last_ptr);
} }
break; break;
default: default: