diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-04-24 16:19:42 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-05-09 10:59:21 +0200 |
commit | 544631cab1140044524bf6bc04ec8c5c275627b6 (patch) | |
tree | 28462ce2ccd7d40d13585eca03b74160fd119bb8 /fftools/ffprobe.c | |
parent | 13180968f8058118c177815b11b4afd11ac9df08 (diff) | |
download | ffmpeg-544631cab1140044524bf6bc04ec8c5c275627b6.tar.gz |
ffprobe: only hash extradata when it is present
Passing zero-sized/NULL buffers to av_hash_update() is invalid and may
crash with certain hashes.
Diffstat (limited to 'fftools/ffprobe.c')
-rw-r--r-- | fftools/ffprobe.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index b07032bd88..f7c5db8613 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2748,8 +2748,11 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id if (do_show_data) writer_print_data(w, "extradata", par->extradata, par->extradata_size); - writer_print_data_hash(w, "extradata_hash", par->extradata, - par->extradata_size); + + if (par->extradata_size > 0) { + writer_print_data_hash(w, "extradata_hash", par->extradata, + par->extradata_size); + } /* Print disposition information */ #define PRINT_DISPOSITION(flagname, name) do { \ |