avfilter/hqdn3d: an invalid bit depth means a bug, not invalid read data
authorClément Bœsch <u@pkh.me>
Sun, 8 Feb 2015 16:16:21 +0000 (17:16 +0100)
committerClément Bœsch <u@pkh.me>
Sun, 8 Feb 2015 16:16:51 +0000 (17:16 +0100)
This code looks clumsy, and an assert would probably be more welcome.

libavfilter/vf_hqdn3d.c

index 4b1f2f9..99d22d9 100644 (file)
@@ -155,7 +155,7 @@ static int denoise_depth(HQDN3DContext *s,
 
 #define denoise(...)                                                          \
     do {                                                                      \
-        int ret = AVERROR_INVALIDDATA;                                        \
+        int ret = AVERROR_BUG;                                                \
         switch (s->depth) {                                                   \
             case  8: ret = denoise_depth(__VA_ARGS__,  8); break;             \
             case  9: ret = denoise_depth(__VA_ARGS__,  9); break;             \