You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
apedec: assert that s->samples is not negative before trying to decode
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
#include "get_bits.h"
|
#include "get_bits.h"
|
||||||
#include "bytestream.h"
|
#include "bytestream.h"
|
||||||
#include "libavutil/audioconvert.h"
|
#include "libavutil/audioconvert.h"
|
||||||
|
#include "libavutil/avassert.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
@@ -834,6 +835,10 @@ static int ape_decode_frame(AVCodecContext *avctx,
|
|||||||
return AVERROR(EINVAL);
|
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){
|
if(!s->samples){
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
void *tmp_data;
|
void *tmp_data;
|
||||||
|
Reference in New Issue
Block a user