[FFmpeg-devel] [PATCH] avformat/utils: only call h264 decoder private function if h264 decoder is in use

Michael Niedermayer michael at niedermayer.cc
Sun Oct 30 02:48:42 EEST 2016


On Sun, Sep 18, 2016 at 01:46:07PM +0200, Timo Rothenpieler wrote:
> Fixes a crash when decoding with for example h264_cuvid, as
> avpriv_h264_has_num_reorder_frames assumes the AVCodecContext->priv_data
> to be a H264Context.
> ---
>  libavformat/utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index d605a96..06003dd 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -935,7 +935,7 @@ static int has_decode_delay_been_guessed(AVStream *st)
>      if (!st->info) // if we have left find_stream_info then nb_decoded_frames won't increase anymore for stream copy
>          return 1;
>  #if CONFIG_H264_DECODER
> -    if (st->internal->avctx->has_b_frames &&
> +    if (st->internal->avctx->has_b_frames && !strcmp(st->internal->avctx->codec->name, "h264") &&
>         avpriv_h264_has_num_reorder_frames(st->internal->avctx) == st->internal->avctx->has_b_frames)
>          return 1;

has the issue been fixed for all branches an cases or is something
missing that needs this ?
(if so this needs a null pointer check i think)


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161030/5c6f7473/attachment.sig>


More information about the ffmpeg-devel mailing list