[FFmpeg-trac] #10460(avcodec:new): gif decoder reuses buffer without flagging it

FFmpeg trac at avcodec.org
Tue Jul 11 10:31:02 EEST 2023


#10460: gif decoder reuses buffer without flagging it
------------------------------------+--------------------------------------
             Reporter:  delusional  |                     Type:  defect
               Status:  new         |                 Priority:  normal
            Component:  avcodec     |                  Version:  git-master
             Keywords:  gif         |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+--------------------------------------
 According to the get_buffer2 documentation the codec is supposed to signal
 that it'll reuse the returned buffer with the flag
 AV_GET_BUFFER_FLAG_REF[1].

 The gif decoder doesn't set this flag
     libavcodec/gifdec.c:492 if ((ret = ff_get_buffer(avctx, s->frame, 0))
 < 0)

 yet attempts to reuse the buffer until the next keyframe
     libavcodec/gifdec.c:508 if ((ret = ff_reget_buffer(avctx, s->frame,
 0)) < 0)

 This leads to a bug in libav users that rely on get_buffer2 not being
 reused like gstreamer[2].

 [1]:
 https://ffmpeg.org/doxygen/6.0/structAVCodecContext.html#aef79333a4c6abf1628c55d75ec82bede
 [2]: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2792
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10460>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list