<div dir="ltr"><div><div>libavcodec has codes like this one :<br><br>static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt,<br>                               AVPacketList **plast_pktl)<br>{<br>    AVPacketList *pktl = av_mallocz(sizeof(AVPacketList));<br>    if (!pktl)<br>        return NULL;<br><br>    if (*packet_buffer)<br>        (*plast_pktl)->next = pktl;<br>    else<br>        *packet_buffer = pktl;<br><br>    /* Add the packet in the buffered packet list. */<br>    *plast_pktl = pktl;<br>    pktl->pkt   = *pkt; <===========================<br>    return &pktl->pkt;<br>}<br><br><br></div>Here a struct variable is meant to be copied over via assignment, is that 100% correct to always work the way was intended?  Given that the struct pkt is a big struct which has raw bytes that are malloc'd. I was always trained to avoid such struct assignment operations. What do people think?<br><br>Ratin<br></div></div>