[FFmpeg-devel] [PATCH 12/36] avcodec/mp3_header_decompress_bsf: Don't output uninitialized CRC

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sat May 30 19:05:17 EEST 2020


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavcodec/mp3_header_decompress_bsf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mp3_header_decompress_bsf.c b/libavcodec/mp3_header_decompress_bsf.c
index 44c174c21c..fe021deed3 100644
--- a/libavcodec/mp3_header_decompress_bsf.c
+++ b/libavcodec/mp3_header_decompress_bsf.c
@@ -85,7 +85,7 @@ static int mp3_header_decompress(AVBSFContext *ctx, AVPacket *out)
 
     header |= (bitrate_index&1)<<9;
     header |= (bitrate_index>>1)<<12;
-    header |= (frame_size == buf_size + 4)<<16; //FIXME actually set a correct crc instead of 0
+    header |= (frame_size == buf_size + 4)<<16;
 
     ret = av_new_packet(out, frame_size);
     if (ret < 0)
@@ -109,6 +109,10 @@ static int mp3_header_decompress(AVBSFContext *ctx, AVPacket *out)
         }
     }
 
+    if (frame_size == buf_size + 6) {
+        //FIXME actually set a correct crc instead of 0
+        AV_WN16(out->data + 4, 0);
+    }
     AV_WB32(out->data, header);
 
     ret = 0;
-- 
2.20.1



More information about the ffmpeg-devel mailing list