[FFmpeg-devel] [PATCH] Making process of uuid-xmp faster.

Michael Niedermayer michael at niedermayer.cc
Tue Nov 8 14:09:44 EET 2016


On Tue, Nov 08, 2016 at 04:34:13PM +0800, Chen Meng wrote:
> ---
>  libavformat/mov.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index f06de06..388cd1f 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -4533,13 +4533,20 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>          if (!buffer) {
>              return AVERROR(ENOMEM);
>          }
> -        ret = avio_read(pb, buffer, len);
> +
> +        if (c->export_xmp) {
> +            ret = avio_read(pb, buffer, len);
> +            if (ret != len) {
> +                av_free(buffer);
> +                return AVERROR_INVALIDDATA;
> +            }

this looses the error code in ret

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- 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/20161108/3d7a19a1/attachment.sig>


More information about the ffmpeg-devel mailing list