On 1/4/2020 4:00 PM, Nicolas George wrote: > Fix CID 1457229. > > Signed-off-by: Nicolas George <geo...@nsup.org> > --- > libavcodec/avpacket.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c > index 858f827a0a..4da832c53c 100644 > --- a/libavcodec/avpacket.c > +++ b/libavcodec/avpacket.c > @@ -170,7 +170,7 @@ FF_DISABLE_DEPRECATION_WARNINGS > #define ALLOC_MALLOC(data, size) data = av_malloc(size) > #define ALLOC_BUF(data, size) \ > do { \ > - av_buffer_realloc(&pkt->buf, size); \ > + ret = av_buffer_realloc(&pkt->buf, size); \ > data = pkt->buf ? pkt->buf->data : NULL; \ > } while (0) > > @@ -197,6 +197,8 @@ do { \ > /* Makes duplicates of data, side_data, but does not copy any other fields */ > static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup) > { > + int ret = AVERROR_BUG; > + > pkt->data = NULL; > pkt->side_data = NULL; > pkt->side_data_elems = 0; > @@ -220,7 +222,8 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket > *src, int dup) > > failed_alloc: > av_packet_unref(pkt); > - return AVERROR(ENOMEM); > + av_assert1(ret != AVERROR_BUG); > + return ret; > } > > int av_copy_packet_side_data(AVPacket *pkt, const AVPacket *src)
This code is deprecated and will be removed in the next major bump, so IMO it's worth trying to fix it, and especially if it's just to silence a static analyzer. _______________________________________________ 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".