avcodec/hevc_parser: check for av_mallocz() failure
authorPaul B Mahol <onemda@gmail.com>
Mon, 9 Feb 2015 13:14:45 +0000 (13:14 +0000)
committerPaul B Mahol <onemda@gmail.com>
Tue, 10 Feb 2015 09:35:23 +0000 (09:35 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/hevc_parser.c

index 834b93b..a6fdbb7 100644 (file)
@@ -309,6 +309,8 @@ static int hevc_init(AVCodecParserContext *s)
 {
     HEVCContext  *h  = &((HEVCParseContext *)s->priv_data)->h;
     h->HEVClc = av_mallocz(sizeof(HEVCLocalContext));
+    if (!h->HEVClc)
+        return AVERROR(ENOMEM);
     h->skipped_bytes_pos_size = INT_MAX;
 
     return 0;