[FFmpeg-devel,06/10] avformat/asfdec_o: Don't reset twice

Submitted by Andreas Rheinhardt on Sept. 18, 2019, 3:26 a.m.

Details

Message ID 20190918032607.11774-6-andreas.rheinhardt@gmail.com
State New
Headers show

Commit Message

Andreas Rheinhardt Sept. 18, 2019, 3:26 a.m.
A variable has been assigned a value twice consecutively; essentially
the same happens when one performs av_init_packet on an AVPacket after
a call to av_packet_unref.

Found via PVS-Studio (see ticket #8156).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/asfdec_o.c | 2 --
 1 file changed, 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 26f9609f27..e90820373e 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -1142,9 +1142,7 @@  static void reset_packet(ASFPacket *asf_pkt)
     asf_pkt->duration  = 0;
     asf_pkt->flags     = 0;
     asf_pkt->dts       = 0;
-    asf_pkt->duration  = 0;
     av_packet_unref(&asf_pkt->avpkt);
-    av_init_packet(&asf_pkt->avpkt);
 }
 
 static int asf_read_replicated_data(AVFormatContext *s, ASFPacket *asf_pkt)