Andreas Rheinhardt (12021-03-01):
> > thanks for the info, this struct is expected to be in side_data in the 
> > future, 
> > I'll add 'bboxes[1]' in it, and allocate sizeof(*header) + (nb_bbox - 1) * 
> > sizeof(*bbox).
> 
> Notice that in this case it is undefined behaviour to access any of the
> boxes outside of BoundingBoxHeader (i.e. when using header->bboxes[i],
> the compiler is allowed to infer that i == 0 as all other cases would be
> undefined behaviour).

Are you sure about it? Can you quote the standard?

Anyway, even if this is true, we can work around it with an extra
pointer or a cast, possibly wrapped in a macro. Saving a few dynamic
allocation is well worth the unusual code; we should shoo away the
people who oppose to go work on GStreamer or something.

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: PGP signature

_______________________________________________
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".

Reply via email to