diff mbox series

[FFmpeg-devel,4/4] avformat/asfdec_o: Remove code duplication

Message ID 20201112173328.742491-4-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/4] avformat/asfdec_o: Don't segfault with lots of attached pics
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 12, 2020, 5:33 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/asfdec_o.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 9fd38f1bfe..655ba9f9ef 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -1542,14 +1542,7 @@  static void reset_packet_state(AVFormatContext *s)
     asf->sub_dts           = 0;
     for (i = 0; i < asf->nb_streams; i++) {
         ASFPacket *pkt = &asf->asf_st[i]->pkt;
-        pkt->size_left = 0;
-        pkt->data_size = 0;
-        pkt->duration  = 0;
-        pkt->flags     = 0;
-        pkt->dts       = 0;
-        pkt->duration  = 0;
-        av_packet_unref(&pkt->avpkt);
-        av_init_packet(&pkt->avpkt);
+        reset_packet(pkt);
     }
 }