[FFmpeg-cvslog] avplay: Check format allocation inside decode_thread()

Vittorio Giovara git at videolan.org
Tue Feb 17 21:23:49 CET 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Wed Feb  4 14:21:01 2015 +0000| [733f4b05f0e120ddd0393b23f2b6d9106cf922e4] | committer: Vittorio Giovara

avplay: Check format allocation inside decode_thread()

CC: libav-stable at libav.org
Bug-Id: CID 1265718

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

 avplay.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/avplay.c b/avplay.c
index 5c6fcfd..b1ce057 100644
--- a/avplay.c
+++ b/avplay.c
@@ -2257,6 +2257,11 @@ static int decode_thread(void *arg)
     global_video_state = is;
 
     ic = avformat_alloc_context();
+    if (!ic) {
+        av_log(NULL, AV_LOG_FATAL, "Could not allocate context.\n");
+        ret = AVERROR(ENOMEM);
+        goto fail;
+    }
     ic->interrupt_callback.callback = decode_interrupt_cb;
     err = avformat_open_input(&ic, is->filename, is->iformat, &format_opts);
     if (err < 0) {



More information about the ffmpeg-cvslog mailing list