[FFmpeg-devel] [PATCH 3/7] lavc/utils: check av_frame_alloc() failure.

Michael Niedermayer michaelni at gmx.at
Sun Dec 29 19:13:53 CET 2013


On Sun, Dec 29, 2013 at 05:30:18PM +0100, Nicolas George wrote:
> Le nonidi 9 nivôse, an CCXXII, Michael Niedermayer a écrit :
> > LGTM if the error pathes where tested under valgrind or similar
> 
> It was hard, because they are old APIs and there are no tests for them.
> 

> Also, avcodec_decode_audio3() is currently broken, see the attached patch.

hmm, this doesnt set s->release_buffer= avcodec_default_release_buffer;
is that intended ?
A user app could have set
s->release_buffer= avcodec_default_release_buffer; or equivalent


> 
> Did *you* test your commit (c90f311)? :-Þ

i test almost all my comits but its quite possible that what i tested
(fate probably) did never test the code i changed, thats my mistake
no question about that

I think we should add some fate tests for old APIs
maybe the examples could be adapted to do that, i could look into that
but as you tested the code, i assume you already have a test for them?

Thanks


> 
> Regards,
> 
> -- 
>   Nicolas George

>  utils.c |    2 ++
>  1 file changed, 2 insertions(+)
> 416a65c70f7a2253a7e918e14bc3f70b372295a3  0001-lavc-fix-old-avcodec_decode_audio3.patch
> From fdecd4fc86aa26140456a2021e79568e96b738a5 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Sun, 29 Dec 2013 17:22:44 +0100
> Subject: [PATCH] lavc: fix old avcodec_decode_audio3().
> 
> AVCodecContext.get_buffer is no longer being set at codec
> initialization.
> 
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  libavcodec/utils.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index f660133..f35fb1b 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -2162,6 +2162,8 @@ int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa
>  
>      if (!frame)
>          return AVERROR(ENOMEM);
> +    if (!avctx->get_buffer)
> +        avctx->get_buffer = avcodec_default_get_buffer;
>      if (avctx->get_buffer != avcodec_default_get_buffer) {
>          av_log(avctx, AV_LOG_ERROR, "Custom get_buffer() for use with"
>                                      "avcodec_decode_audio3() detected. Overriding with avcodec_default_get_buffer\n");
> -- 
> 1.8.5.2
> 




> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131229/6c73fee1/attachment.asc>


More information about the ffmpeg-devel mailing list