hds: avoid NULL dereference (cid #1261992)
authorTristan Matthews <tmatth@videolan.org>
Thu, 8 Jan 2015 12:53:40 +0000 (07:53 -0500)
committerTristan Matthews <tmatth@videolan.org>
Thu, 8 Jan 2015 12:53:40 +0000 (07:53 -0500)
metadata_packet_len > 0 is equivalent to
metadata_payload_len > 0 && p_metadata_payload

modules/stream_filter/hds/hds.c

index d84e5be..9a74b67 100644 (file)
@@ -1273,7 +1273,7 @@ static size_t write_flv_header_and_metadata(
     // FLV file header
     memcpy( *pp_buffer, flv_header_bytes, FLV_FILE_HEADER_LEN );
 
-    if ( metadata_payload_len > 0 )
+    if ( metadata_packet_len > 0 )
     {
         uint8_t *p = *pp_buffer + FLV_FILE_HEADER_LEN;