فهرست منبع

media-io: Fix check before passing pointer to av_freep

Found by clang-3.7 (trunk 236075) via -Wpointer-bool-conversion:

warning: address of array 'rs->output_buffer' will always evaluate
to 'true'
Palana 10 سال پیش
والد
کامیت
4daa5c7aa7
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      libobs/media-io/audio-resampler-ffmpeg.c

+ 1 - 1
libobs/media-io/audio-resampler-ffmpeg.c

@@ -121,7 +121,7 @@ void audio_resampler_destroy(audio_resampler_t *rs)
 	if (rs) {
 		if (rs->context)
 			swr_free(&rs->context);
-		if (rs->output_buffer)
+		if (rs->output_buffer[0])
 			av_freep(&rs->output_buffer[0]);
 
 		bfree(rs);