[FFmpeg-cvslog] avformat/demux: preserve AV_PKT_FLAG_CORRUPT in parse_packet

Alex Shumsky git at videolan.org
Fri Oct 29 19:39:33 EEST 2021


ffmpeg | branch: master | Alex Shumsky <alexthreed at gmail.com> | Thu Oct 21 19:21:31 2021 +0300| [3925b826df365a2365118600bd7910cbca95286d] | committer: James Almer

avformat/demux: preserve AV_PKT_FLAG_CORRUPT in parse_packet

If original packet is corrupted, then parsed packet is probably corrupted too.
Let the application decide what to do.

Signed-off-by: Alex Shumsky <alexthreed at gmail.com>

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

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

diff --git a/libavformat/demux.c b/libavformat/demux.c
index 6a4b687bf1..71a1a9bf03 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -1179,7 +1179,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
         out_pkt->pts          = sti->parser->pts;
         out_pkt->dts          = sti->parser->dts;
         out_pkt->pos          = sti->parser->pos;
-        out_pkt->flags       |= pkt->flags & AV_PKT_FLAG_DISCARD;
+        out_pkt->flags       |= pkt->flags & (AV_PKT_FLAG_DISCARD | AV_PKT_FLAG_CORRUPT);
 
         if (sti->need_parsing == AVSTREAM_PARSE_FULL_RAW)
             out_pkt->pos = sti->parser->frame_offset;



More information about the ffmpeg-cvslog mailing list