[FFmpeg-devel] [PATCH 05/10] avformat/asfdec_o: Unify switch cases

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Wed Sep 18 06:26:02 EEST 2019


Found via PVS-Studio (see ticket #8156).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavformat/asfdec_o.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 8e7f044ce9..26f9609f27 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -316,6 +316,7 @@ static int asf_read_generic_value(AVIOContext *pb, int type, uint64_t *value)
 
     switch (type) {
     case ASF_BOOL:
+    case ASF_WORD:
         *value = avio_rl16(pb);
         break;
     case ASF_DWORD:
@@ -324,9 +325,6 @@ static int asf_read_generic_value(AVIOContext *pb, int type, uint64_t *value)
     case ASF_QWORD:
         *value = avio_rl64(pb);
         break;
-    case ASF_WORD:
-        *value = avio_rl16(pb);
-        break;
     default:
         return AVERROR_INVALIDDATA;
     }
-- 
2.20.1



More information about the ffmpeg-devel mailing list