Re: [FFmpeg-devel] [PATCH 3/4] avcodec/sanm: Optimize fill_frame() with av_memcpy_backptr()

2019-07-08 Thread Michael Niedermayer
On Fri, Jun 28, 2019 at 10:53:44PM +0200, Michael Niedermayer wrote:
> Fixes: Timeout (76 sec -> 24 sec)
> Fixes: 
> 15043/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5699856238116864
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/sanm.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 3/4] avcodec/sanm: Optimize fill_frame() with av_memcpy_backptr()

2019-06-28 Thread Michael Niedermayer
Fixes: Timeout (76 sec -> 24 sec)
Fixes: 
15043/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5699856238116864

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/sanm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index 811fd2188e..25aee7220f 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -1358,8 +1358,10 @@ static int read_frame_header(SANMVideoContext *ctx, 
SANMFrameHeader *hdr)
 
 static void fill_frame(uint16_t *pbuf, int buf_size, uint16_t color)
 {
-while (buf_size--)
+if (buf_size--) {
 *pbuf++ = color;
+av_memcpy_backptr((uint8_t*)pbuf, 2, 2*buf_size);
+}
 }
 
 static int copy_output(SANMVideoContext *ctx, SANMFrameHeader *hdr)
-- 
2.22.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".