aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/scpr3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-03-14 21:23:03 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-03-20 21:12:45 +0100
commit8f63fa4c2ec1cbdc92d3ebe29ff5b498e4acafdb (patch)
treee511e4bd7299704f7cf766f1b940ba92b1c1260e /libavcodec/scpr3.c
parent21b90435d6025f3bf93b2592cd83214a98c54bde (diff)
downloadffmpeg-8f63fa4c2ec1cbdc92d3ebe29ff5b498e4acafdb.tar.gz
avcodec/scpr: Perform frame copy later
Optimization found while looking at 13442/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-5758293933293568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/scpr3.c')
-rw-r--r--libavcodec/scpr3.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/scpr3.c b/libavcodec/scpr3.c
index b59a8cc28f..f92ccfa902 100644
--- a/libavcodec/scpr3.c
+++ b/libavcodec/scpr3.c
@@ -1081,6 +1081,10 @@ static int decompress_p3(AVCodecContext *avctx,
}
}
+ ret = av_frame_copy(s->current_frame, s->last_frame);
+ if (ret < 0)
+ return ret;
+
for (y = 0; y < s->nby; y++) {
for (x = 0; x < s->nbx; x++) {
int sy1 = 0, sy2 = 16, sx1 = 0, sx2 = 16;