disable FRGM decoding for good in libwebpmux

Change-Id: I2f24d100f93488f6b0bf9ccc5818f9177d73948b
This commit is contained in:
Pascal Massimino 2013-03-20 20:27:52 +00:00 committed by James Zern
parent 4b956be095
commit 783dfa4995
2 changed files with 10 additions and 0 deletions

View File

@ -306,6 +306,11 @@ WebPMuxError WebPMuxPushFrame(WebPMux* mux, const WebPMuxFrameInfo* frame,
if (!(is_frame || (frame->id == WEBP_CHUNK_FRGM))) { if (!(is_frame || (frame->id == WEBP_CHUNK_FRGM))) {
return WEBP_MUX_INVALID_ARGUMENT; return WEBP_MUX_INVALID_ARGUMENT;
} }
#ifndef WEBP_EXPERIMENTAL_FEATURES
if (frame->id == WEBP_CHUNK_FRGM) { // disabled for now.
return WEBP_MUX_INVALID_ARGUMENT;
}
#endif
if (bitstream->bytes == NULL || bitstream->size > MAX_CHUNK_PAYLOAD) { if (bitstream->bytes == NULL || bitstream->size > MAX_CHUNK_PAYLOAD) {
return WEBP_MUX_INVALID_ARGUMENT; return WEBP_MUX_INVALID_ARGUMENT;

View File

@ -223,7 +223,9 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data,
MuxImageInit(wpi); // Reset for reading next image. MuxImageInit(wpi); // Reset for reading next image.
break; break;
case WEBP_CHUNK_ANMF: case WEBP_CHUNK_ANMF:
#ifdef WEBP_EXPERIMENTAL_FEATURES
case WEBP_CHUNK_FRGM: case WEBP_CHUNK_FRGM:
#endif
if (wpi->is_partial_) goto Err; // Previous wpi is still incomplete. if (wpi->is_partial_) goto Err; // Previous wpi is still incomplete.
if (!MuxImageParse(&chunk, copy_data, wpi)) goto Err; if (!MuxImageParse(&chunk, copy_data, wpi)) goto Err;
ChunkRelease(&chunk); ChunkRelease(&chunk);
@ -378,6 +380,9 @@ static WebPMuxError MuxGetFrameFragmentInternal(const WebPMuxImage* const wpi,
const int is_frame = (wpi->header_->tag_ == kChunks[IDX_ANMF].tag); const int is_frame = (wpi->header_->tag_ == kChunks[IDX_ANMF].tag);
const CHUNK_INDEX idx = is_frame ? IDX_ANMF : IDX_FRGM; const CHUNK_INDEX idx = is_frame ? IDX_ANMF : IDX_FRGM;
const WebPData* frame_frgm_data; const WebPData* frame_frgm_data;
#ifndef WEBP_EXPERIMENTAL_FEATURES
if (!is_frame) return WEBP_MUX_INVALID_ARGUMENT;
#endif
assert(wpi->header_ != NULL); // Already checked by WebPMuxGetFrame(). assert(wpi->header_ != NULL); // Already checked by WebPMuxGetFrame().
// Get frame/fragment chunk. // Get frame/fragment chunk.
frame_frgm_data = &wpi->header_->data_; frame_frgm_data = &wpi->header_->data_;