OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f964c6
)
avcodec/flac_parser: Check for av_malloc() failure
author
Michael Niedermayer
<michaelni@gmx.at>
Thu, 15 Jan 2015 15:51:08 +0000
(16:51 +0100)
committer
Michael Niedermayer
<michaelni@gmx.at>
Thu, 15 Jan 2015 16:09:39 +0000
(17:09 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/flac_parser.c
patch
|
blob
|
history
diff --git
a/libavcodec/flac_parser.c
b/libavcodec/flac_parser.c
index
bc874c5
..
d16af29
100644
(file)
--- a/
libavcodec/flac_parser.c
+++ b/
libavcodec/flac_parser.c
@@
-192,6
+192,11
@@
static int find_headers_search_validate(FLACParseContext *fpc, int offset)
(*end_handle)->offset = offset;
(*end_handle)->link_penalty = av_malloc(sizeof(int) *
FLAC_MAX_SEQUENTIAL_HEADERS);
+ if (!(*end_handle)->link_penalty) {
+ av_freep(end_handle);
+ return AVERROR(ENOMEM);
+ }
+
for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS; i++)
(*end_handle)->link_penalty[i] = FLAC_HEADER_NOT_PENALIZED_YET;