[Coverity 1665590] Dereference null return value in input/meta.c
If the function actually returns a null value, a null pointer dereference will occur.
In vlc_meta_Merge: Return value of function which returns null is dereferenced without checking (CWE-476)
231 for( int i = 0; ppsz_all_keys && ppsz_all_keys[i]; i++ )
232 {
233 /* Always try to remove the previous value */
234 struct vlc_meta_value *dst_meta_value = vlc_dictionary_value_for_key( &dst->extra_tags, ppsz_all_keys[i] );
14. returned_null: vlc_dictionary_value_for_key returns NULL (checked 22 out of 23 times).[show details]
15. var_assigned: Assigning: src_meta_value = NULL return value from vlc_dictionary_value_for_key.
235 struct vlc_meta_value *src_meta_value = vlc_dictionary_value_for_key( &src->extra_tags, ppsz_all_keys[i] );
16. Condition dst_meta_value, taking false branch.
236 if( dst_meta_value )
237 {
238 /* overwrite metadata only when priority of src is
239 greater than or equal to the priority of dst */
CID 1665590:(#1 of 2):Dereference null return value (NULL_RETURNS) [ "select issue" ]
240 if( src_meta_value->priority < dst_meta_value->priority )
241 continue;
242
243 vlc_dictionary_remove_value_for_key( &dst->extra_tags, ppsz_all_keys[i], vlc_meta_FreeExtraKey, NULL );
244 }
245
CID 1665590: (#2 of 2): Dereference null return value (NULL_RETURNS)
17. dereference: Dereferencing src_meta_value, which is known to be NULL.
246 vlc_meta_InsertExtra( dst, ppsz_all_keys[i], src_meta_value->value, src_meta_value->priority );