Browse code

avfilter/vf_shuffleframes: Assert that the case of an uninitialized ret does not occur

Fixes CID1258479

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Michael Niedermayer authored on 2015/12/02 03:11:44
Showing 1 changed files
... ...
@@ -18,6 +18,7 @@
18 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
  */
20 20
 
21
+#include "libavutil/avassert.h"
21 22
 #include "libavutil/avstring.h"
22 23
 #include "libavutil/common.h"
23 24
 #include "libavutil/internal.h"
... ...
@@ -90,9 +91,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
90 90
         s->pts[s->in_frames] = frame->pts;
91 91
         s->in_frames++;
92 92
         ret = 0;
93
-    }
94
-
95
-    if (s->in_frames == s->nb_frames) {
93
+    } else if (s->in_frames == s->nb_frames) {
96 94
         int n, x;
97 95
 
98 96
         for (n = 0; n < s->nb_frames; n++) {
... ...
@@ -109,7 +108,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
109 109
 
110 110
         for (n = 0; n < s->nb_frames; n++)
111 111
             av_frame_free(&s->frames[n]);
112
-    }
112
+    } else
113
+        av_assert0(0);
113 114
 
114 115
     return ret;
115 116
 }