apedec: assert that s->samples is not negative before trying to decode
This commit is contained in:
parent
0927154d37
commit
9a33264478
1 changed files with 5 additions and 0 deletions
|
|
@ -26,6 +26,7 @@
|
|||
#include "get_bits.h"
|
||||
#include "bytestream.h"
|
||||
#include "libavutil/audioconvert.h"
|
||||
#include "libavutil/avassert.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
|
@ -834,6 +835,10 @@ static int ape_decode_frame(AVCodecContext *avctx,
|
|||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
/* this should never be negative, but bad things will happen if it is, so
|
||||
check it just to make sure. */
|
||||
av_assert0(s->samples >= 0);
|
||||
|
||||
if(!s->samples){
|
||||
uint32_t offset;
|
||||
void *tmp_data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue