]> git.sesse.net Git - ffmpeg/commitdiff
avformat/vapoursynth: properly initialize err variable in read_header_vs()
authornu774 <honeycomb77@gmail.com>
Thu, 3 Jan 2019 17:17:02 +0000 (02:17 +0900)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Jan 2019 13:58:19 +0000 (14:58 +0100)
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.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/vapoursynth.c

index f3ad6910e58361438fd1a8100114dc948adad7c6..69fde1a806c9d51bda17fa1c15c370b6c605cad4 100644 (file)
@@ -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) {