aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-07 16:54:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-07 20:03:04 +0200
commit99119bdffe17ac8919f0f97ace61251ad4bc6a2a (patch)
tree5e651d86b59ec2531bd929ad2000037022f443b3 /ffplay.c
parent6fd00e9dd94ac3aecf4fa14ca6fa23c395215ac9 (diff)
downloadffmpeg-99119bdffe17ac8919f0f97ace61251ad4bc6a2a.tar.gz
ffplay: fix null pointer read when codec unavilable.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ffplay.c b/ffplay.c
index d76ea5b69d..60b6207d45 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2191,6 +2191,9 @@ static int stream_component_open(VideoState *is, int stream_index)
}
codec = avcodec_find_decoder(avctx->codec_id);
+ if (!codec)
+ return -1;
+
avctx->debug_mv = debug_mv;
avctx->debug = debug;
avctx->workaround_bugs = workaround_bugs;
@@ -2210,8 +2213,7 @@ static int stream_component_open(VideoState *is, int stream_index)
if(codec->capabilities & CODEC_CAP_DR1)
avctx->flags |= CODEC_FLAG_EMU_EDGE;
- if (!codec ||
- avcodec_open(avctx, codec) < 0)
+ if (avcodec_open(avctx, codec) < 0)
return -1;
/* prepare audio output */