mirror of https://git.ffmpeg.org/ffmpeg.git
segafilm: fail earlier in case theres not enough bytestream left for a
audio packet. This prevents a potentially large memory allocation. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
27d323577c
commit
1795fed7bc
|
@ -30,6 +30,7 @@
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
#include "avio_internal.h"
|
||||||
|
|
||||||
#define FILM_TAG MKBETAG('F', 'I', 'L', 'M')
|
#define FILM_TAG MKBETAG('F', 'I', 'L', 'M')
|
||||||
#define FDSC_TAG MKBETAG('F', 'D', 'S', 'C')
|
#define FDSC_TAG MKBETAG('F', 'D', 'S', 'C')
|
||||||
|
@ -264,6 +265,8 @@ static int film_read_packet(AVFormatContext *s,
|
||||||
(film->audio_type != CODEC_ID_ADPCM_ADX)) {
|
(film->audio_type != CODEC_ID_ADPCM_ADX)) {
|
||||||
/* stereo PCM needs to be interleaved */
|
/* stereo PCM needs to be interleaved */
|
||||||
|
|
||||||
|
if (ffio_limit(pb, sample->sample_size) != sample->sample_size)
|
||||||
|
return AVERROR(EIO);
|
||||||
if (av_new_packet(pkt, sample->sample_size))
|
if (av_new_packet(pkt, sample->sample_size))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue