diff options
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/flac_parser.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c index bc874c558b..d16af29efd 100644 --- 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; |