summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avplay.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/avplay.c b/avplay.c
index 5c6fcfdb0b..b1ce057d46 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) {