summaryrefslogtreecommitdiff
path: root/libavcodec/pngenc.c
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2019-05-10 22:28:38 +0800
committerJun Zhao <barryjzhao@tencent.com>2019-05-12 14:18:25 +0800
commit1cc7e2630fecac0b91e28f402a02f7e268c9d156 (patch)
treeb5cef55119a9bdf72552116af3bebe5744f3a386 /libavcodec/pngenc.c
parent64e610b5f4b7c338713208a4dfa24a8f2eb728c8 (diff)
downloadffmpeg-1cc7e2630fecac0b91e28f402a02f7e268c9d156.tar.gz
lavc/pngenc: check malloc fail before using the pointer
Need to check malloc fail before using the pointer Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavcodec/pngenc.c')
-rw-r--r--libavcodec/pngenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 69b4495404..d4d8dc8b5e 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -748,11 +748,11 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict,
original_bytestream_end = s->bytestream_end;
temp_bytestream = av_malloc(original_bytestream_end - original_bytestream);
- temp_bytestream_end = temp_bytestream + (original_bytestream_end - original_bytestream);
if (!temp_bytestream) {
ret = AVERROR(ENOMEM);
goto fail;
}
+ temp_bytestream_end = temp_bytestream + (original_bytestream_end - original_bytestream);
for (last_fctl_chunk.dispose_op = 0; last_fctl_chunk.dispose_op < 3; ++last_fctl_chunk.dispose_op) {
// 0: APNG_DISPOSE_OP_NONE