aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-07-20 01:14:51 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-07-20 16:12:08 +0200
commit3c43a7a354e8ad9e6a270b592cd7c5c1f3f62110 (patch)
treeb438bc2e3505a36d02a0373ee637b5267894e569
parent636a629ff63ef60c9b31ba87e8e0a90e1f277c97 (diff)
downloadffmpeg-3c43a7a354e8ad9e6a270b592cd7c5c1f3f62110.tar.gz
avcodec/hdrdec: lines can be empty
Fixes: infinite loop Fixes: 49223/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HDR_fuzzer-6603308596330496 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/hdrdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hdrdec.c b/libavcodec/hdrdec.c
index 458215c6ac..29e87057fa 100644
--- a/libavcodec/hdrdec.c
+++ b/libavcodec/hdrdec.c
@@ -107,7 +107,7 @@ static int hdr_decode_frame(AVCodecContext *avctx, AVFrame *p,
hdr_get_line(&gb, line, sizeof(line));
if (sscanf(line, "PIXASPECT=%f\n", &sar) == 1)
avctx->sample_aspect_ratio = p->sample_aspect_ratio = av_inv_q(av_d2q(sar, 4096));
- } while (line[0] != '\n');
+ } while (line[0] != '\n' && line[0]);
hdr_get_line(&gb, line, sizeof(line));
if (sscanf(line, "-Y %d +X %d\n", &height, &width) == 2) {