From b4d9693e4a354575d662ef768f6bb1c06defa7b4 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Tue, 4 Nov 2014 17:35:29 +0800 Subject: [PATCH] ff_ffplay: merge 2ec4a84dca603a24a8131297036dfe30eed33dd7 ffplay: Separate AVFrame from AVSubtitle This is more robust and should avoid false positives in coverity That is if the type is ever mixed up, after this patch that would just be a null pointer dereference instead of a random possibly out of array access --- ijkmedia/ijkplayer/ff_ffplay.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ijkmedia/ijkplayer/ff_ffplay.c b/ijkmedia/ijkplayer/ff_ffplay.c index a8152ffc..ced9b38f 100644 --- a/ijkmedia/ijkplayer/ff_ffplay.c +++ b/ijkmedia/ijkplayer/ff_ffplay.c @@ -288,9 +288,8 @@ static void decoder_init(Decoder *d, AVCodecContext *avctx, PacketQueue *queue, d->start_pts = AV_NOPTS_VALUE; } -static int decoder_decode_frame(FFPlayer *ffp, Decoder *d, void *fframe) { +static int decoder_decode_frame(FFPlayer *ffp, Decoder *d, AVFrame *frame, AVSubtitle *sub) { int got_frame = 0; - AVFrame *frame = fframe; d->flushed = 0; @@ -1138,7 +1137,7 @@ static int get_video_frame(FFPlayer *ffp, AVFrame *frame) VideoState *is = ffp->is; int got_picture; - if ((got_picture = decoder_decode_frame(ffp, &is->viddec, frame)) < 0) + if ((got_picture = decoder_decode_frame(ffp, &is->viddec, frame, NULL)) < 0) return -1; if (got_picture) { @@ -1717,7 +1716,7 @@ static int audio_decode_frame(FFPlayer *ffp) return resampled_data_size; } - if ((got_frame = decoder_decode_frame(ffp, &is->auddec, is->frame)) < 0) + if ((got_frame = decoder_decode_frame(ffp, &is->auddec, is->frame, NULL)) < 0) return -1; if (is->auddec.flushed) -- GitLab