[FFmpeg-devel] [PATCH 8/9] movenc-test: fix potential uninitialized read

James Almer jamrial at gmail.com
Wed Nov 8 20:27:50 EET 2017


On 11/8/2017 3:17 PM, Timo Rothenpieler wrote:
> Fixes CID #1413023
> ---
>  libavformat/tests/movenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/tests/movenc.c b/libavformat/tests/movenc.c
> index 8e59b74259..a210aec7ba 100644
> --- a/libavformat/tests/movenc.c
> +++ b/libavformat/tests/movenc.c
> @@ -108,7 +108,7 @@ static int io_write_data_type(void *opaque, uint8_t *buf, int size,
>                                enum AVIODataMarkerType type, int64_t time)
>  {
>      char timebuf[30], content[5] = { 0 };
> -    const char *str;
> +    const char *str = "unknown";

Maybe make it a default case inside the switch statement instead?

>      switch (type) {
>      case AVIO_DATA_MARKER_HEADER:         str = "header";   break;
>      case AVIO_DATA_MARKER_SYNC_POINT:     str = "sync";     break;
> 


More information about the ffmpeg-devel mailing list