Message ID | 20190217194453.8030-1-cus@passwd.hu |
---|---|
State | Accepted |
Commit | 9f8854cb5ad98e1b6456099e38c06d5eba3431ca |
Headers | show |
On Sun, 17 Feb 2019, Marton Balint wrote: > This should fix the following Coverity false positives: > > Coverity CID #1405450. > Coverity CID #1430930. > > Signed-off-by: Marton Balint <cus@passwd.hu> Ping for the series, will apply soon. Regards, Marton
On Sun, 24 Feb 2019, Marton Balint wrote: > > > On Sun, 17 Feb 2019, Marton Balint wrote: > >> This should fix the following Coverity false positives: >> >> Coverity CID #1405450. >> Coverity CID #1430930. >> >> Signed-off-by: Marton Balint <cus@passwd.hu> > > Ping for the series, will apply soon. Applied. Regards, Marton
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index 11ac4e80cd..8f0603df78 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -616,6 +616,7 @@ int av_packet_ref(AVPacket *dst, const AVPacket *src) ret = packet_alloc(&dst->buf, src->size); if (ret < 0) goto fail; + av_assert1(!src->size || src->data); if (src->size) memcpy(dst->buf->data, src->data, src->size); @@ -668,6 +669,7 @@ int av_packet_make_refcounted(AVPacket *pkt) ret = packet_alloc(&pkt->buf, pkt->size); if (ret < 0) return ret; + av_assert1(!pkt->size || pkt->data); if (pkt->size) memcpy(pkt->buf->data, pkt->data, pkt->size); @@ -687,6 +689,7 @@ int av_packet_make_writable(AVPacket *pkt) ret = packet_alloc(&buf, pkt->size); if (ret < 0) return ret; + av_assert1(!pkt->size || pkt->data); if (pkt->size) memcpy(buf->data, pkt->data, pkt->size);
This should fix the following Coverity false positives: Coverity CID #1405450. Coverity CID #1430930. Signed-off-by: Marton Balint <cus@passwd.hu> --- libavcodec/avpacket.c | 3 +++ 1 file changed, 3 insertions(+)