[Converter] fix coverity issue 1034478
authorJaeyun <jy1210.jung@samsung.com>
Wed, 10 Oct 2018 02:18:37 +0000 (11:18 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Wed, 10 Oct 2018 04:01:37 +0000 (13:01 +0900)
1. add condition to check frame size (divide by zero)
2. remove debug message (unnecessary to print frames)

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
gst/tensor_converter/tensor_converter.c

index 4cb29a2..cf21464 100644 (file)
@@ -610,6 +610,7 @@ gst_tensor_converter_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
     case _NNS_OCTET:
       /** get frame size from the properties */
       frame_size = gst_tensor_info_get_size (&config->info);
+      g_assert (frame_size > 0);
       g_assert ((buf_size % frame_size) == 0);
       frames_in = buf_size / frame_size;
       break;
@@ -620,10 +621,8 @@ gst_tensor_converter_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
       return GST_FLOW_ERROR;
   }
 
-  silent_debug ("frames in incoming buffer = %d", frames_in);
-
   if (frames_in == frames_out) {
-    /** do nothing, push the incoming buffer  */
+    /** do nothing, push the incoming buffer */
     return gst_pad_push (self->srcpad, inbuf);
   }