[FFmpeg-cvslog] avcodec/hevc_parser: check for av_mallocz() failure

Paul B Mahol git at videolan.org
Tue Feb 10 10:39:31 CET 2015


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Feb  9 13:14:45 2015 +0000| [a5398aa56cfbf80acb409451cd807660402a34d4] | committer: Paul B Mahol

avcodec/hevc_parser: check for av_mallocz() failure

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5398aa56cfbf80acb409451cd807660402a34d4
---

 libavcodec/hevc_parser.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index 834b93b..a6fdbb7 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -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;



More information about the ffmpeg-cvslog mailing list