On Fri, Mar 04, 2016 at 03:41:23AM +0100, Mats Peterson wrote:
> On 03/04/2016 03:30 AM, Michael Niedermayer wrote:
> >>
> >>- if (!*palette && ret == CONTAINS_PAL)
> >>- *palette = pkt->data + pkt->size - AVPALETTE_SIZE;
> >>+ if (!*palette && ret == CONTAINS_PAL) {
> >>+ uint8_t *pkt_pal = pkt->data + pkt->size - AVPALETTE_SIZE;
> >>+ int i;
> >>+ for (i = 0; i < AVPALETTE_COUNT; i++) {
> >>+ uint8_t *p8 = pkt_pal + 4*i;
> >
> >>+ uint32_t *p32 = (uint32_t *)p8;
> >
> >undefined behavior, violating alignment requirements, and possibly
> >aliassing violation
> >
>
> Really? It works just fine, so please elaborate.you cant cast arbitrary pointers to uint32_t uint32_t can have platform specific alignment requirements that are stricter than what a random 4 uint8_t have. pkt->size does not need to be a multiple of 4 so even if pkt->data would be aligned enough p8 doesnt have to be > > > > >>+ *p32 = AV_RL32(p8); > > > >corrupting potenially shared or read only input packet > > > >[...] > > That one I do understand. > > _______________________________________________ > ffmpeg-devel mailing list > [email protected] > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB While the State exists there can be no freedom; when there is freedom there will be no State. -- Vladimir Lenin
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
