aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-16 21:18:09 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-06-18 20:53:56 +0200
commit567eacd42ebbc0e9b9164e2783cbda390806f800 (patch)
tree211c5e9d8bd9a62fe7d62161d51c1416fad66d9b
parenta6bd1bdd12e95d7a3aa2fbcd57494f0d7b1f6dcb (diff)
downloadffmpeg-567eacd42ebbc0e9b9164e2783cbda390806f800.tar.gz
avformat/fifo: check for flushed packets and timeshift
Fixes: CID1464151 Dereference after null check Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 3e44bd068fc19baeaab3295fce8379c68e4b2b2a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/fifo.c2
1 files changed, 1 insertions, 1 deletions
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;