[FFmpeg-devel] [PATCH 1/2] avformat/mxfdec: Don't use wrong type of pointer
Tomas Härdin
tjoppen at acc.umu.se
Mon Mar 15 11:22:02 EET 2021
fre 2021-03-12 klockan 14:07 +0100 skrev Andreas Rheinhardt:
> @@ -2922,20 +2929,19 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
> }
> }
> }
> - if (ctx_size && tag == 0x3C0A) {
> - avio_read(pb, ctx->uid, 16);
> + if (meta && tag == 0x3C0A) {
Why not keep this conditional on ctx_size? That way you could get rid
of ctx altogether
> + avio_read(pb, meta->uid, 16);
> } else if ((ret = read_child(ctx, pb, tag, size, uid, -1)) < 0) {
This could be ctx_size ? meta : mxf
> - if (ctx_size)
> - mxf_free_metadataset(&ctx, 1);
> + if (meta)
> + mxf_free_metadataset(&meta, 1);
Please add {} while you're at it
/Tomas
More information about the ffmpeg-devel
mailing list