提交 b4d9693e 编写于 作者: Z Zhang Rui

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
上级 1279792c
...@@ -288,9 +288,8 @@ static void decoder_init(Decoder *d, AVCodecContext *avctx, PacketQueue *queue, ...@@ -288,9 +288,8 @@ static void decoder_init(Decoder *d, AVCodecContext *avctx, PacketQueue *queue,
d->start_pts = AV_NOPTS_VALUE; 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; int got_frame = 0;
AVFrame *frame = fframe;
d->flushed = 0; d->flushed = 0;
...@@ -1138,7 +1137,7 @@ static int get_video_frame(FFPlayer *ffp, AVFrame *frame) ...@@ -1138,7 +1137,7 @@ static int get_video_frame(FFPlayer *ffp, AVFrame *frame)
VideoState *is = ffp->is; VideoState *is = ffp->is;
int got_picture; 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; return -1;
if (got_picture) { if (got_picture) {
...@@ -1717,7 +1716,7 @@ static int audio_decode_frame(FFPlayer *ffp) ...@@ -1717,7 +1716,7 @@ static int audio_decode_frame(FFPlayer *ffp)
return resampled_data_size; 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; return -1;
if (is->auddec.flushed) if (is->auddec.flushed)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册