summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-20 19:56:49 +0100
committerMarton Balint <cus@passwd.hu>2011-11-21 20:20:48 +0100
commit2c28e26913df927e71d87fa851c9d950f281523b (patch)
treed1b3e1d485e3b711dd394a358fd9288d4b185a6f /ffplay.c
parent2f0f9a87d0e8d27ce6ad5b81134d01b9d2392cd1 (diff)
ffplay: Check for pix_fmt changes Fixes Ticket238 by not crashing but also not playing the file.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index 46cf6a12d8..673f31db15 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1562,7 +1562,10 @@ static int input_get_buffer(AVCodecContext *codec, AVFrame *pic)
edge = codec->flags & CODEC_FLAG_EMU_EDGE ? 0 : avcodec_get_edge_width();
w += edge << 1;
h += edge << 1;
-
+ if (codec->pix_fmt != ctx->outputs[0]->format) {
+ av_log(codec, AV_LOG_ERROR, "Pixel format mismatches %d %d\n", codec->pix_fmt, ctx->outputs[0]->format);
+ return -1;
+ }
if(!(ref = avfilter_get_video_buffer(ctx->outputs[0], perms, w, h)))
return -1;