1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/j2kenc: Check for av_strtok() failure

Fixes: CID1466601 Dereference null return value

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-05-18 22:44:19 +02:00
parent 9d40782088
commit 6a6a765fa4

View File

@ -1682,7 +1682,7 @@ static int parse_layer_rates(Jpeg2000EncoderContext *s)
}
token = av_strtok(s->lr_str, ",", &saveptr);
if (rate = strtol(token, NULL, 10)) {
if (token && (rate = strtol(token, NULL, 10))) {
s->layer_rates[0] = rate <= 1 ? 0:rate;
nlayers++;
} else {