You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
wavdec: avoid output of arbitrary chars
use av_get_codec_tag_string() in wav_read_header() for printing the faulty start code from riff header Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
1a971d33eb
commit
e8d57e4163
@@ -249,6 +249,7 @@ static int wav_read_header(AVFormatContext *s)
|
|||||||
int64_t size, av_uninit(data_size);
|
int64_t size, av_uninit(data_size);
|
||||||
int64_t sample_count = 0;
|
int64_t sample_count = 0;
|
||||||
int rf64 = 0;
|
int rf64 = 0;
|
||||||
|
char start_code[5];
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
AVIOContext *pb = s->pb;
|
AVIOContext *pb = s->pb;
|
||||||
AVStream *st = NULL;
|
AVStream *st = NULL;
|
||||||
@@ -272,7 +273,8 @@ static int wav_read_header(AVFormatContext *s)
|
|||||||
rf64 = 1;
|
rf64 = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
av_log(s, AV_LOG_ERROR, "invalid start code %c%c%c%c in RIFF header\n", tag & 0xFF, (tag >> 8) & 0xFF, (tag >> 16) & 0xFF, (tag >> 24) & 0xFF);
|
av_get_codec_tag_string(start_code, 5, tag);
|
||||||
|
av_log(s, AV_LOG_ERROR, "invalid start code %s in RIFF header\n", start_code);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user