OSDN Git Service

ffprobe: check av_frame_alloc() failure.
authorNicolas George <george@nsup.org>
Sun, 29 Dec 2013 09:37:58 +0000 (10:37 +0100)
committerNicolas George <george@nsup.org>
Mon, 30 Dec 2013 09:58:01 +0000 (10:58 +0100)
ffprobe.c

index 0374d37..ef3bcc6 100644 (file)
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1887,6 +1887,10 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
     }
 
     frame = av_frame_alloc();
+    if (!frame) {
+        ret = AVERROR(ENOMEM);
+        goto end;
+    }
     while (!av_read_frame(fmt_ctx, &pkt)) {
         if (selected_streams[pkt.stream_index]) {
             AVRational tb = fmt_ctx->streams[pkt.stream_index]->time_base;