diff options
author | Andriy Gelman <andriy.gelman@gmail.com> | 2019-10-06 01:49:49 -0400 |
---|---|---|
committer | Gyan Doshi <ffmpeg@gyani.pro> | 2019-10-16 10:34:51 +0530 |
commit | e14f5fd0a6983838b5fe3c6ad1c2ec2f2d8e49df (patch) | |
tree | e51369c976cccb414ab8bed0e0c3b00a01e4b230 /libavformat/chromaprint.c | |
parent | 29dac2927f5fa0b1f5c6b27a3ed32f2968ea9b00 (diff) | |
download | ffmpeg-e14f5fd0a6983838b5fe3c6ad1c2ec2f2d8e49df.tar.gz |
avformat/chromaprint: Fix writing raw fingerprint
The pointer fp after the call to chromaprint_get_raw_fingerpoint() points to an array
of uint32_t whereas the current code assumed just a char stream. Thus when writing the
raw fingerprint, the output would be truncated by a factor of 4.
For reference the declaration of the function from chromaprint.h is:
int chromaprint_get_raw_fingerprint(ChromaprintContext *ctx, uint32_t **fingerprint, int *size);
Diffstat (limited to 'libavformat/chromaprint.c')
-rw-r--r-- | libavformat/chromaprint.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/chromaprint.c b/libavformat/chromaprint.c index a4c0b97d99..faa92ca0db 100644 --- a/libavformat/chromaprint.c +++ b/libavformat/chromaprint.c @@ -136,7 +136,7 @@ static int write_trailer(AVFormatContext *s) switch (cpr->fp_format) { case FINGERPRINT_RAW: - avio_write(pb, fp, size); + avio_write(pb, fp, size * 4); //fp points to array of uint32_t break; case FINGERPRINT_COMPRESSED: case FINGERPRINT_BASE64: |