[FFmpeg-cvslog] avformat/bink: move code for skipping unknown fields to correct place

Paul B Mahol git at videolan.org
Sun Jul 22 11:33:49 EEST 2018


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Jul 16 12:54:47 2018 +0200| [251329fa76c0dd9be7f1d78173b3314cc7364dc4] | committer: Paul B Mahol

avformat/bink: move code for skipping unknown fields to correct place

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=251329fa76c0dd9be7f1d78173b3314cc7364dc4
---

 libavformat/bink.c | 14 ++++++++------
 1 file 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++) {



More information about the ffmpeg-cvslog mailing list