diff mbox

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

Message ID 20190918032607.11774-5-andreas.rheinhardt@gmail.com
State New
Headers show

Commit Message

Andreas Rheinhardt Sept. 18, 2019, 3:26 a.m. UTC
Found via PVS-Studio (see ticket #8156).

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

Comments

Carl Eugen Hoyos Sept. 18, 2019, 10:29 p.m. UTC | #1
Am Mi., 18. Sept. 2019 um 05:33 Uhr schrieb Andreas Rheinhardt
<andreas.rheinhardt@gmail.com>:
>
> Found via PVS-Studio (see ticket #8156).
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavformat/asfdec_o.c | 4 +---

Instead please remove this demuxer, it cannot be used for any testing.

Carl Eugen
diff mbox

Patch

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;
     }