avcodec/rawdec: Use linesize in b64a
Fixes: out of array access
Fixes: 19750/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RAWVIDEO_fuzzer-5074834119983104
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2b5b9d5dac
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -467,11 +467,14 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
avctx->pix_fmt == AV_PIX_FMT_RGBA64BE) {
|
avctx->pix_fmt == AV_PIX_FMT_RGBA64BE) {
|
||||||
uint8_t *dst = frame->data[0];
|
uint8_t *dst = frame->data[0];
|
||||||
uint64_t v;
|
uint64_t v;
|
||||||
int x;
|
int x, y;
|
||||||
for (x = 0; x >> 3 < avctx->width * avctx->height; x += 8) {
|
for (y = 0; y < avctx->height; y++) {
|
||||||
|
for (x = 0; x >> 3 < avctx->width; x += 8) {
|
||||||
v = AV_RB64(&dst[x]);
|
v = AV_RB64(&dst[x]);
|
||||||
AV_WB64(&dst[x], v << 16 | v >> 48);
|
AV_WB64(&dst[x], v << 16 | v >> 48);
|
||||||
}
|
}
|
||||||
|
dst += frame->linesize[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->field_order > AV_FIELD_PROGRESSIVE) { /* we have interlaced material flagged in container */
|
if (avctx->field_order > AV_FIELD_PROGRESSIVE) { /* we have interlaced material flagged in container */
|
||||||
|
Reference in New Issue
Block a user