diff mbox

[FFmpeg-devel] avformat/vapoursynth: properly initialize err variable in read_header_vs()

Message ID 20190103171703.18096-1-honeycomb77@gmail.com
State Accepted
Commit e0686318ddd7a5138d1847d97fe967fb2e813802
Headers show

Commit Message

nu774 Jan. 3, 2019, 5:17 p.m. UTC
The variable "err" is not initialized, and set only when something went wrong.
When everything is OK, nobody sets it, so using it result in UB.
---
 libavformat/vapoursynth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Jan. 4, 2019, 3:01 p.m. UTC | #1
On Fri, Jan 04, 2019 at 02:17:02AM +0900, nu774 wrote:
> The variable "err" is not initialized, and set only when something went wrong.
> When everything is OK, nobody sets it, so using it result in UB.
> ---
>  libavformat/vapoursynth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

thanks

[...]
diff mbox

Patch

diff --git a/libavformat/vapoursynth.c b/libavformat/vapoursynth.c
index f3ad6910e5..69fde1a806 100644
--- a/libavformat/vapoursynth.c
+++ b/libavformat/vapoursynth.c
@@ -177,7 +177,7 @@  static av_cold int read_header_vs(AVFormatContext *s)
     char dummy;
     const VSVideoInfo *info;
     struct VSState *vss_state;
-    int err;
+    int err = 0;
 
     vss_state = av_mallocz(sizeof(*vss_state));
     if (!vss_state) {