]> granicus.if.org Git - handbrake/commitdiff
decavcodec: fix more potential uses of uninitialized variables
authorTim Walker <tdskywalker@gmail.com>
Tue, 8 Jan 2019 17:57:40 +0000 (18:57 +0100)
committerTim Walker <tdskywalker@gmail.com>
Tue, 8 Jan 2019 17:57:40 +0000 (18:57 +0100)
Fixes a crash I experienced locally following 76f14dad963db46961ce3d425a102ac3d898ce10

Inspired by 3c95342a8cdf5b3b03d8b5e94ec099b0bc6a4f35

libhb/decavcodec.c

index 1c3f51070af4bb37556d66d341744e33ee99822c..9afe318edf801dcc261a1dff61243a1addb236e6 100644 (file)
@@ -427,8 +427,8 @@ static void decavcodecClose( hb_work_object_t * w )
 static void audioParserFlush(hb_work_object_t * w)
 {
     hb_work_private_t * pv = w->private_data;
-    uint8_t * pout;
-    int       pout_len;
+    uint8_t * pout = NULL;
+    int       pout_len = 0;
     int64_t   parser_pts;
 
     do
@@ -1723,8 +1723,8 @@ static void videoParserFlush(hb_work_object_t * w)
 {
     hb_work_private_t * pv = w->private_data;
     int       result;
-    uint8_t * pout;
-    int       pout_len;
+    uint8_t * pout = NULL;
+    int       pout_len = 0;
     int64_t   parser_pts, parser_dts;
 
     do
@@ -1842,8 +1842,8 @@ static int decavcodecvWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
     }
     for (pos = 0; pos < in->size; pos += len)
     {
-        uint8_t * pout;
-        int       pout_len;
+        uint8_t * pout = NULL;
+        int       pout_len = 0;
         int64_t   parser_pts, parser_dts;
 
         if (pv->parser)