flac_parser: check return value of av_fifo_alloc()
authorPaul B Mahol <onemda@gmail.com>
Sun, 30 Jun 2013 16:49:45 +0000 (16:49 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sun, 30 Jun 2013 16:49:45 +0000 (16:49 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/flac_parser.c

index ded7bde..69c2965 100644 (file)
@@ -692,6 +692,8 @@ static av_cold int flac_parse_init(AVCodecParserContext *c)
     /* There will generally be FLAC_MIN_HEADERS buffered in the fifo before
        it drains.  This is allocated early to avoid slow reallocation. */
     fpc->fifo_buf = av_fifo_alloc(FLAC_AVG_FRAME_SIZE * (FLAC_MIN_HEADERS + 3));
+    if (!fpc->fifo_buf)
+        return AVERROR(ENOMEM);
     return 0;
 }