diff options
Diffstat (limited to 'ffmpeg/libavformat/nistspheredec.c')
| -rw-r--r-- | ffmpeg/libavformat/nistspheredec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ffmpeg/libavformat/nistspheredec.c b/ffmpeg/libavformat/nistspheredec.c index c09df9c..2c96686 100644 --- a/ffmpeg/libavformat/nistspheredec.c +++ b/ffmpeg/libavformat/nistspheredec.c @@ -36,7 +36,7 @@ static int nist_read_header(AVFormatContext *s) { char buffer[32], coding[32] = "pcm", format[32] = "01"; int bps = 0, be = 0; - int32_t header_size; + int32_t header_size = -1; AVStream *st; st = avformat_new_stream(s, NULL); @@ -108,8 +108,11 @@ static int nist_read_header(AVFormatContext *s) sscanf(buffer, "%*s %*s %"SCNd32, &st->codec->bits_per_coded_sample); } else { char key[32], value[32]; - sscanf(buffer, "%31s %*s %31s", key, value); - av_dict_set(&s->metadata, key, value, AV_DICT_APPEND); + if (sscanf(buffer, "%31s %*s %31s", key, value) == 3) { + av_dict_set(&s->metadata, key, value, AV_DICT_APPEND); + } else { + av_log(s, AV_LOG_ERROR, "Failed to parse '%s' as metadata\n", buffer); + } } } |
