[FFmpeg-devel] [PATCH 4/4] h264: Check all allocations

Michael Niedermayer michaelni at gmx.at
Tue Oct 22 23:20:34 CEST 2013


On Tue, Oct 22, 2013 at 09:33:59PM +0100, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> ---
>  libavcodec/h264.c | 37 ++++++++++++++++++++++++++-----------
>  1 file changed, 26 insertions(+), 11 deletions(-)
[...]

> @@ -1738,11 +1743,15 @@ static int decode_update_thread_context(AVCodecContext *dst,
>          h->mb_stride = h1->mb_stride;
>          h->b_stride  = h1->b_stride;
>          // SPS/PPS
> -        copy_parameter_set((void **)h->sps_buffers, (void **)h1->sps_buffers,
> -                        MAX_SPS_COUNT, sizeof(SPS));
> +        if ((ret = copy_parameter_set((void **)h->sps_buffers,
> +                                      (void **)h1->sps_buffers,
> +                                      MAX_SPS_COUNT, sizeof(SPS))) < 0);
> +            return ret;

you have a ; too much here


>          h->sps = h1->sps;
> -        copy_parameter_set((void **)h->pps_buffers, (void **)h1->pps_buffers,
> -                        MAX_PPS_COUNT, sizeof(PPS));
> +        if ((ret = copy_parameter_set((void **)h->pps_buffers,
> +                                      (void **)h1->pps_buffers,
> +                                      MAX_PPS_COUNT, sizeof(PPS))) < 0);
> +            return ret;

and here

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

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- 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/20131022/e67d718b/attachment.asc>


More information about the ffmpeg-devel mailing list