OSDN Git Service

avcodec/flac_parser: print error messages in case of errors
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 17 Jan 2015 00:40:39 +0000 (01:40 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 17 Jan 2015 00:40:39 +0000 (01:40 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/flac_parser.c

index d16af29..ed0da55 100644 (file)
@@ -194,6 +194,8 @@ static int find_headers_search_validate(FLACParseContext *fpc, int offset)
                                             FLAC_MAX_SEQUENTIAL_HEADERS);
         if (!(*end_handle)->link_penalty) {
             av_freep(end_handle);
+            av_log(fpc->avctx, AV_LOG_ERROR,
+                   "couldn't allocate link_penalty\n");
             return AVERROR(ENOMEM);
         }
 
@@ -712,8 +714,11 @@ 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_array(FLAC_MIN_HEADERS + 3, FLAC_AVG_FRAME_SIZE);
-    if (!fpc->fifo_buf)
+    if (!fpc->fifo_buf) {
+        av_log(fpc->avctx, AV_LOG_ERROR,
+                "couldn't allocate fifo_buf\n");
         return AVERROR(ENOMEM);
+    }
     return 0;
 }