Browse Source

avformat/adxdec: dont return random data on EOF

Fixes use of uninitialized memory
Partly fixes; msan_uninit-mem_7fb7d24780d0_2744_R03T.CAK
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 11 years ago
parent
commit
8aead3ffa8
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/adxdec.c

+ 3
- 1
libavcodec/adxdec.c View File

@@ -157,9 +157,11 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
buf_size -= BLOCK_SIZE; buf_size -= BLOCK_SIZE;
buf += BLOCK_SIZE; buf += BLOCK_SIZE;
} }
samples_offset += BLOCK_SAMPLES;
if (!c->eof)
samples_offset += BLOCK_SAMPLES;
} }


frame->nb_samples = samples_offset;
*got_frame_ptr = 1; *got_frame_ptr = 1;


return buf - avpkt->data; return buf - avpkt->data;


Loading…
Cancel
Save