mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-25 07:20:10 +01:00
Fix infinite loop with bad data in Wwise Vorbis
This commit is contained in:
parent
e42aebf945
commit
ff5ffac950
@ -59,7 +59,7 @@ static int rv_bits(bitstream_t* ib, uint32_t bits, uint32_t* value) {
|
||||
|
||||
return 1;
|
||||
fail:
|
||||
VGM_LOG("BITREADER: read fail\n");
|
||||
VGM_LOG_ONCE("BITREADER: read fail\n");
|
||||
*value = 0;
|
||||
return 0;
|
||||
}
|
||||
@ -95,7 +95,7 @@ static int wv_bits(bitstream_t* ob, uint32_t bits, uint32_t value) {
|
||||
ob->b_off += bits;
|
||||
return 1;
|
||||
fail:
|
||||
VGM_LOG("BITREADER: write fail\n");
|
||||
VGM_LOG_ONCE("BITREADER: write fail\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -160,6 +160,9 @@ static int read_packet(wpacket_t* wp, uint8_t* ibuf, size_t ibufsize, STREAMFILE
|
||||
break;
|
||||
}
|
||||
|
||||
if (wp->header_size == 0 || wp->packet_size == 0)
|
||||
goto fail;
|
||||
|
||||
/* read packet data */
|
||||
{
|
||||
size_t read_size = wp->packet_size;
|
||||
|
Loading…
Reference in New Issue
Block a user