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.
|
// WebP container demux.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -754,6 +755,7 @@ static int SynthesizeFrame(const WebPDemuxer* const dmux,
|
|||||||
const uint8_t* const payload =
|
const uint8_t* const payload =
|
||||||
GetFramePayload(mem_buf, fragment, &payload_size);
|
GetFramePayload(mem_buf, fragment, &payload_size);
|
||||||
if (payload == NULL) return 0;
|
if (payload == NULL) return 0;
|
||||||
|
assert(first_frame != NULL);
|
||||||
|
|
||||||
iter->frame_num = first_frame->frame_num_;
|
iter->frame_num = first_frame->frame_num_;
|
||||||
iter->num_frames = dmux->num_frames_;
|
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_;
|
if (frame_num == 0) frame_num = dmux->num_frames_;
|
||||||
|
|
||||||
frame = GetFrame(dmux, frame_num);
|
frame = GetFrame(dmux, frame_num);
|
||||||
|
if (frame == NULL) return 0;
|
||||||
|
|
||||||
return SynthesizeFrame(dmux, frame, 1, iter);
|
return SynthesizeFrame(dmux, frame, 1, iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user