summaryrefslogtreecommitdiff
path: root/libavformat/aiffdec.c
diff options
context:
space:
mode:
authorEduard Sinelnikov <endushka@gmail.com>2018-01-08 14:03:40 +0000
committerMichael Niedermayer <michael@niedermayer.cc>2018-01-11 03:29:25 +0100
commit7fcbebbeafd106d5bab82b272076f7ceb5bc4a73 (patch)
tree99d7cf48ea01db333b364ace90ccd6d497625c61 /libavformat/aiffdec.c
parent526a87b47124bfd2d57901d1b9abd6d322eaf293 (diff)
downloadffmpeg-7fcbebbeafd106d5bab82b272076f7ceb5bc4a73.tar.gz
avformat/aiffdec: AIFF fix in case of ANNO
Apple's AIFF protocol clearly states that each chucnk which is odd sized a padding should be added. In the old version of aiffdec adding of padding was done in `get_meta`. And in case of unknown chunk name it was done in defalut case. The new version has deleted the padding in default case and added padding adding after the switch. But the new version didn't removed the padding adding in the `get_meta` function so in some cases padding was added twice which leaded to a bug. Fixes: sample.aiff Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/aiffdec.c')
-rw-r--r--libavformat/aiffdec.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index e87fbc5661..7c701e0c70 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -81,11 +81,10 @@ static void get_meta(AVFormatContext *s, const char *key, int size)
av_free(str);
return;
}
- size += (size&1)-res;
+ size -= res;
str[res] = 0;
av_dict_set(&s->metadata, key, str, AV_DICT_DONT_STRDUP_VAL);
- }else
- size+= size&1;
+ }
avio_skip(s->pb, size);
}