Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-09-10 23:57:54 +0400
committerPaul B Mahol <onemda@gmail.com>2013-09-11 15:06:44 +0400
commit00e1bf8a587e26029f8fb20a35c65b99fe14196b (patch)
treea3147aa1a9f5fafa9d8b64fc1b2ff54e7a838ce3 /libavformat/flic.c
parent803445e02c773fc29040629abdc297534ab6c3f3 (diff)
avformat/flic: check for memory allocation failures
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/flic.c')
-rw-r--r--libavformat/flic.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/flic.c b/libavformat/flic.c
index 2835cf557b..e04e2778c9 100644
--- a/libavformat/flic.c
+++ b/libavformat/flic.c
@@ -125,8 +125,10 @@ static int flic_read_header(AVFormatContext *s)
}
/* send over the whole 128-byte FLIC header */
- st->codec->extradata_size = FLIC_HEADER_SIZE;
st->codec->extradata = av_malloc(FLIC_HEADER_SIZE);
+ if (!st->codec->extradata)
+ return AVERROR(ENOMEM);
+ st->codec->extradata_size = FLIC_HEADER_SIZE;
memcpy(st->codec->extradata, header, FLIC_HEADER_SIZE);
/* peek at the preamble to detect TFTD videos - they seem to always start with an audio chunk */
@@ -176,8 +178,10 @@ static int flic_read_header(AVFormatContext *s)
/* send over abbreviated FLIC header chunk */
av_free(st->codec->extradata);
- st->codec->extradata_size = 12;
st->codec->extradata = av_malloc(12);
+ if (!st->codec->extradata)
+ return AVERROR(ENOMEM);
+ st->codec->extradata_size = 12;
memcpy(st->codec->extradata, header, 12);
} else if (magic_number == FLIC_FILE_MAGIC_1) {