Commit b192fc29d6 for ffmpeg
commit b192fc29d662c2ada3fc9d9a944a20486ba4eff5
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Tue Oct 13 22:44:08 2026 +0200
avformat/rtpdec_rfc4175: Return the recovered frame with its own timestamp
When a packet of the next frame ended a frame whose marker was
missed, that frame was returned with the timestamp of the next frame.
This is not a security issue.
Fixes: Gcg4mf6RNmEA
Wrong timestamp Replicated through API
Found-by: Forgejo Fairy while reviewing PR #24949
diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c
index 32b09ae80b..cbb1afd050 100644
--- a/libavformat/rtpdec_rfc4175.c
+++ b/libavformat/rtpdec_rfc4175.c
@@ -269,7 +269,10 @@ static int rfc4175_handle_packet(AVFormatContext *ctx, PayloadContext *data,
if (!data->frame)
data->frame = av_mallocz(data->frame_size + AV_INPUT_BUFFER_PADDING_SIZE);
- data->timestamp = *timestamp;
+ if (missed_last_packet)
+ FFSWAP(uint32_t, data->timestamp, *timestamp);
+ else
+ data->timestamp = *timestamp;
if (!data->frame) {
av_log(ctx, AV_LOG_ERROR, "Out of memory.\n");