[FFmpeg-devel] [PATCH] avformat/mxfdec: fix pixel format extraction for cinema j2k

Rémi Achard remiachard at gmail.com
Mon Sep 14 12:48:37 EEST 2020


>
> Why this added hunk? Appending strong refs like this is likely to have
> all sorts of unintended effects. The same MaterialPackages will appear
> multiple times for example.


This is my attempt to fix an issue in the fate tests.

If you look at mxf_read_generic_descriptor, there is two places where we
call mxf_read_strong_ref_array, if this happens on the same descriptor the
second call will override the first one. This happen in the test suite for
an XAVC file CDCI descriptor, see the previous post I made for the breaking
test example.

I'll look into your concerns.

Le lun. 14 sept. 2020 à 10:40, Tomas Härdin <tjoppen at acc.umu.se> a écrit :

> sön 2020-09-13 klockan 23:42 +0100 skrev Rémi Achard:
> >
> > @@ -855,15 +857,19 @@ static int mxf_read_cryptographic_context(void
> *arg, AVIOContext *pb, int tag, i
> >
> >  static int mxf_read_strong_ref_array(AVIOContext *pb, UID **refs, int
> *count)
> >  {
> > -    *count = avio_rb32(pb);
> > -    av_free(*refs);
> > -    *refs = av_calloc(*count, sizeof(UID));
> > +    int local_count;
> > +
> > +    local_count = avio_rb32(pb);
> > +    *refs = av_realloc_array(*refs, *count + local_count, sizeof(UID));
> > +
> >      if (!*refs) {
> >          *count = 0;
> >          return AVERROR(ENOMEM);
> >      }
> >      avio_skip(pb, 4); /* useless size of objects, always 16 according
> to specs */
> > -    avio_read(pb, (uint8_t *)*refs, *count * sizeof(UID));
> > +    avio_read(pb, (uint8_t *)(*refs)[*count], local_count *
> sizeof(UID));
> > +    *count += local_count;
> > +
> >      return 0;
> >  }
>
> Why this added hunk? Appending strong refs like this is likely to have
> all sorts of unintended effects. The same MaterialPackages will appear
> multiple times for example.
>
> /Tomas
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list