summaryrefslogtreecommitdiff
path: root/ffmpeg/libavformat/nistspheredec.c
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-12-29 12:19:38 +0000
committerTim Redfern <tim@eclectronics.org>2013-12-29 12:19:38 +0000
commitf7813a5324be39d13ab536c245d15dfc602a7849 (patch)
treefad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavformat/nistspheredec.c
parentb7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff)
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavformat/nistspheredec.c')
-rw-r--r--ffmpeg/libavformat/nistspheredec.c9
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);
+ }
}
}