avcodec/sgidec: fix linesize for 16bit

Fixes: asan_heap-oob_22b30d4_39_038.sgi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3b20ed8548)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-10-27 20:48:58 +01:00
parent 045670a6f7
commit ca47574e16

View File

@@ -145,7 +145,7 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
for (z = 0; z < s->depth; z++) { for (z = 0; z < s->depth; z++) {
dest_row = out_buf; dest_row = out_buf;
for (y = 0; y < s->height; y++) { for (y = 0; y < s->height; y++) {
linesize = s->width * s->depth * s->bytes_per_channel; linesize = s->width * s->depth;
dest_row -= s->linesize; dest_row -= s->linesize;
start_offset = bytestream2_get_be32(&g_table); start_offset = bytestream2_get_be32(&g_table);
bytestream2_seek(&s->g, start_offset, SEEK_SET); bytestream2_seek(&s->g, start_offset, SEEK_SET);