[FFmpeg-cvslog] avformat/fifo: check for flushed packets and timeshift

Michael Niedermayer git at videolan.org
Fri Jun 18 22:14:20 EEST 2021


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Sun May 16 21:18:09 2021 +0200| [567eacd42ebbc0e9b9164e2783cbda390806f800] | committer: Michael Niedermayer

avformat/fifo: check for flushed packets and timeshift

Fixes: CID1464151 Dereference after null check

Reviewed-by: Marton Balint <cus at passwd.hu>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 3e44bd068fc19baeaab3295fce8379c68e4b2b2a)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=567eacd42ebbc0e9b9164e2783cbda390806f800
---

 libavformat/fifo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/fifo.c b/libavformat/fifo.c
index 17748e94ce..a1dca1bc16 100644
--- a/libavformat/fifo.c
+++ b/libavformat/fifo.c
@@ -593,7 +593,7 @@ static int fifo_write_packet(AVFormatContext *avf, AVPacket *pkt)
         goto fail;
     }
 
-    if (fifo->timeshift && pkt->dts != AV_NOPTS_VALUE)
+    if (fifo->timeshift && pkt && pkt->dts != AV_NOPTS_VALUE)
         atomic_fetch_add_explicit(&fifo->queue_duration, next_duration(avf, pkt, &fifo->last_sent_dts), memory_order_relaxed);
 
     return ret;



More information about the ffmpeg-cvslog mailing list