mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
Fix for demuxer frame iteration:
Return error in WebPDemuxGetFrame() when static method GetFrame() returns NULL. Change-Id: Idbc54037047c3df75209ac67ff8bede3f83042be
This commit is contained in:
parent
56c12aa698
commit
b01681a93f
@ -8,6 +8,7 @@
|
||||
// WebP container demux.
|
||||
//
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@ -754,6 +755,7 @@ static int SynthesizeFrame(const WebPDemuxer* const dmux,
|
||||
const uint8_t* const payload =
|
||||
GetFramePayload(mem_buf, fragment, &payload_size);
|
||||
if (payload == NULL) return 0;
|
||||
assert(first_frame != NULL);
|
||||
|
||||
iter->frame_num = first_frame->frame_num_;
|
||||
iter->num_frames = dmux->num_frames_;
|
||||
@ -780,6 +782,8 @@ static int SetFrame(int frame_num, WebPIterator* const iter) {
|
||||
if (frame_num == 0) frame_num = dmux->num_frames_;
|
||||
|
||||
frame = GetFrame(dmux, frame_num);
|
||||
if (frame == NULL) return 0;
|
||||
|
||||
return SynthesizeFrame(dmux, frame, 1, iter);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user