diff options
author | Thomas Volkert <thomas@homer-conferencing.com> | 2014-12-19 23:39:01 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-19 23:43:58 +0100 |
commit | e8d57e41639336d2507a7f017bd45598cbb257d9 (patch) | |
tree | 1838ed639301e87ed08f7b1d8c5fc1e42fd79148 /libavformat/wavdec.c | |
parent | 1a971d33ebedff3cae01ee81da4fa74302a91492 (diff) | |
download | ffmpeg-e8d57e41639336d2507a7f017bd45598cbb257d9.tar.gz |
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>
Diffstat (limited to 'libavformat/wavdec.c')
-rw-r--r-- | libavformat/wavdec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 4b452a62e8..98e97878cb 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -249,6 +249,7 @@ static int wav_read_header(AVFormatContext *s) int64_t size, av_uninit(data_size); int64_t sample_count = 0; int rf64 = 0; + char start_code[5]; uint32_t tag; AVIOContext *pb = s->pb; AVStream *st = NULL; @@ -272,7 +273,8 @@ static int wav_read_header(AVFormatContext *s) rf64 = 1; break; 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; } |