aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2018-07-16 12:54:47 +0200
committerPaul B Mahol <onemda@gmail.com>2018-07-22 10:03:56 +0200
commit251329fa76c0dd9be7f1d78173b3314cc7364dc4 (patch)
treef08ae84fa44520254bcefe8e66a731cccf1341e9
parent3735d55af32e845a7fe591bc4023c057f8e513f9 (diff)
downloadffmpeg-251329fa76c0dd9be7f1d78173b3314cc7364dc4.tar.gz
avformat/bink: move code for skipping unknown fields to correct place
-rw-r--r--libavformat/bink.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavformat/bink.c b/libavformat/bink.c
index 8a05082fcd..567a38cd73 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -92,6 +92,8 @@ static int read_header(AVFormatContext *s)
uint16_t flags;
int keyframe;
int ret;
+ uint32_t signature;
+ uint8_t revision;
vst = avformat_new_stream(s, NULL);
if (!vst)
@@ -160,14 +162,14 @@ static int read_header(AVFormatContext *s)
return AVERROR(EIO);
}
- if (bink->num_audio_tracks) {
- uint32_t signature = (vst->codecpar->codec_tag & 0xFFFFFF);
- uint8_t revision = ((vst->codecpar->codec_tag >> 24) % 0xFF);
+ signature = (vst->codecpar->codec_tag & 0xFFFFFF);
+ revision = ((vst->codecpar->codec_tag >> 24) % 0xFF);
- if ((signature == AV_RL32("BIK") && (revision == 0x6b)) || /* k */
- (signature == AV_RL32("KB2") && (revision == 0x69 || revision == 0x6a || revision == 0x6b))) /* i,j,k */
- avio_skip(pb, 4); /* unknown new field */
+ if ((signature == AV_RL32("BIK") && (revision == 'k')) ||
+ (signature == AV_RL32("KB2") && (revision == 'i' || revision == 'j' || revision == 'k')))
+ avio_skip(pb, 4); /* unknown new field */
+ if (bink->num_audio_tracks) {
avio_skip(pb, 4 * bink->num_audio_tracks); /* max decoded size */
for (i = 0; i < bink->num_audio_tracks; i++) {