diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-26 22:19:48 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-05-19 17:17:35 +0200 |
commit | 1756a83aedd444ad58dce415ce6c0938ddf791ea (patch) | |
tree | 2e89f1d8098fb00397087e02d651152a1f54fb71 /libavformat | |
parent | 5946d0bafa41c43b3534254e9d6f90ad1e337da7 (diff) | |
download | ffmpeg-1756a83aedd444ad58dce415ce6c0938ddf791ea.tar.gz |
libavformat/avienc: Check bits per sample for PAL8
Fixes: assertion failure
Fixes: Ticket 8172
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 35958782819c00211e247332ab18fbf2f28267e1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avienc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c index ac0f04c354..1b8904fa40 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -459,6 +459,14 @@ static int avi_write_header(AVFormatContext *s) && par->format != AV_PIX_FMT_NONE) av_log(s, AV_LOG_ERROR, "%s rawvideo cannot be written to avi, output file will be unreadable\n", av_get_pix_fmt_name(par->format)); + + if (par->format == AV_PIX_FMT_PAL8) { + if (par->bits_per_coded_sample < 0 || par->bits_per_coded_sample > 8) { + av_log(s, AV_LOG_ERROR, "PAL8 with %d bps is not allowed\n", par->bits_per_coded_sample); + return AVERROR(EINVAL); + } + } + break; case AVMEDIA_TYPE_AUDIO: flags = (avi->write_channel_mask == 0) ? FF_PUT_WAV_HEADER_SKIP_CHANNELMASK : 0; |