diff mbox series

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

Message ID 20200530160541.29517-12-andreas.rheinhardt@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/36] avcodec/vp9_superframe_bsf: Check for existence of data before reading it
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 30, 2020, 4:05 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/mp3_header_decompress_bsf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

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;