[FFmpeg-devel] [FFmpeg-cvslog] Merge commit '061a0c14bb5767bca72e3a7227ca400de439ba09'

Michael Niedermayer michael at niedermayer.cc
Mon Apr 24 01:00:48 EEST 2017


On Sat, Apr 22, 2017 at 11:32:41PM +0000, James Almer wrote:
> ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Apr 22 20:08:42 2017 -0300| [bddb2343b6e594e312dadb5d21b408702929ae04] | committer: James Almer
> 
> Merge commit '061a0c14bb5767bca72e3a7227ca400de439ba09'
> 
> * commit '061a0c14bb5767bca72e3a7227ca400de439ba09':
>   decode: restructure the core decoding code
> 
> CUVID decoder adapted by wm4.
> 
> Merged-by: James Almer <jamrial at gmail.com>
> 
[...]

> +static int compat_decode(AVCodecContext *avctx, AVFrame *frame,
> +                         int *got_frame, const AVPacket *pkt)
> +{
> +    AVCodecInternal *avci = avctx->internal;
> +    int ret;
> +
> +    av_assert0(avci->compat_decode_consumed == 0);
> +
> +    *got_frame = 0;
> +    avci->compat_decode = 1;
> +
> +    if (avci->compat_decode_partial_size > 0 &&
> +        avci->compat_decode_partial_size != pkt->size) {
> +        av_log(avctx, AV_LOG_ERROR,
> +               "Got unexpected packet size after a partial decode\n");
> +        ret = AVERROR(EINVAL);
> +        goto finish;
> +    }
> +
> +    if (!avci->compat_decode_partial_size) {
> +        ret = avcodec_send_packet(avctx, pkt);
> +        if (ret == AVERROR_EOF)
> +            ret = 0;
> +        else if (ret == AVERROR(EAGAIN)) {
> +            /* we fully drain all the output in each decode call, so this should not
> +             * ever happen */
> +            ret = AVERROR_BUG;
> +            goto finish;
> +        } else if (ret < 0)
> +            goto finish;
> +    }
> +

> +    while (ret >= 0) {

ret is uninitialized if compat_decode_partial_size != 0


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

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- 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/20170424/801067e9/attachment.sig>


More information about the ffmpeg-devel mailing list