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@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".