mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/wmalosslessdec: shrink output on error so no uninitialized data is returned
Fixes use of uninitialized memory partly fixes: msan_uninit-mem_7f7834b6a530_6473_luckynight-partial.wma Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ae3856dcaf
commit
6b18a6839b
@ -1076,8 +1076,11 @@ static int decode_frame(WmallDecodeCtx *s)
|
|||||||
|
|
||||||
/* decode all subframes */
|
/* decode all subframes */
|
||||||
while (!s->parsed_all_subframes) {
|
while (!s->parsed_all_subframes) {
|
||||||
|
int decoded_samples = s->channel[0].decoded_samples;
|
||||||
if (decode_subframe(s) < 0) {
|
if (decode_subframe(s) < 0) {
|
||||||
s->packet_loss = 1;
|
s->packet_loss = 1;
|
||||||
|
if (s->frame->nb_samples)
|
||||||
|
s->frame->nb_samples = decoded_samples;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user