]> git.sesse.net Git - ffmpeg/blobdiff - ffplay.c
lavf/ffmenc: do not fail on missing codec
[ffmpeg] / ffplay.c
index 8a9f2ad5b1b898309bea6ff1c54f9a57eac08f9e..8140dd9645010f794d24267543f3131eeb3a0bf9 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -2884,6 +2884,11 @@ static int read_thread(void *arg)
     is->eof = 0;
 
     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;
     ic->interrupt_callback.opaque = is;
     if (!av_dict_get(format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) {