From eb4d1cb90e14250fc52c8fe73153b72603b029f8 Mon Sep 17 00:00:00 2001
From: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Date: Sat, 19 Mar 2011 15:35:30 +0100
Subject: [PATCH] ffplay: add existence check on ic->pb in decode_thread()

Fix crash if ic->pb is NULL and ic->pb->error is evaluated. This
happens for example with: ffplay photo.jpeg.
---
 ffplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index d45cce3ed1a..8c34a223553 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2575,7 +2575,7 @@ static int decode_thread(void *arg)
         if (ret < 0) {
             if (ret == AVERROR_EOF || url_feof(ic->pb))
                 eof=1;
-            if (ic->pb->error)
+            if (ic->pb && ic->pb->error)
                 break;
             SDL_Delay(100); /* wait for user event */
             continue;
-- 
GitLab