diff mbox series

[FFmpeg-devel,07/18] avformat/asfdec_f: Avoid stack packet

Message ID 20210319055904.2264501-7-andreas.rheinhardt@gmail.com
State Accepted
Commit 3750390edee4b5b205de09d5539f9f881f80511e
Headers show
Series [FFmpeg-devel,01/18] libavformat/utils: Fix indentation | expand

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 March 19, 2021, 5:58 a.m. UTC
Replace it by using AVFormatInternal.parse_pkt which is otherwise unused
when reading a header.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/asfdec_f.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c
index 1484b544d9..2fae528f4d 100644
--- a/libavformat/asfdec_f.c
+++ b/libavformat/asfdec_f.c
@@ -860,17 +860,17 @@  static int asf_read_header(AVFormatContext *s)
         } else {
             if (!s->keylen) {
                 if (!ff_guidcmp(&g, &ff_asf_content_encryption)) {
+                    AVPacket *pkt = s->internal->parse_pkt;
                     unsigned int len;
-                    AVPacket pkt;
                     av_log(s, AV_LOG_WARNING,
                            "DRM protected stream detected, decoding will likely fail!\n");
                     len= avio_rl32(pb);
                     av_log(s, AV_LOG_DEBUG, "Secret data:\n");
 
-                    if ((ret = av_get_packet(pb, &pkt, len)) < 0)
+                    if ((ret = av_get_packet(pb, pkt, len)) < 0)
                         return ret;
-                    av_hex_dump_log(s, AV_LOG_DEBUG, pkt.data, pkt.size);
-                    av_packet_unref(&pkt);
+                    av_hex_dump_log(s, AV_LOG_DEBUG, pkt->data, pkt->size);
+                    av_packet_unref(pkt);
 
                     len= avio_rl32(pb);
                     if (len > UINT16_MAX)