Commit 93db7261 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

mkv: check for overflow and fix type limit warning

parent 760f62e0
...@@ -559,7 +559,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock ...@@ -559,7 +559,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
// condition when the DTS is correct (keyframe or B frame == NOT P frame) // condition when the DTS is correct (keyframe or B frame == NOT P frame)
} }
frame_size += data->Size(); frame_size += data->Size();
if( !data->Buffer() || data->Size() > SIZE_MAX || frame_size > block_size ) if( !data->Buffer() || data->Size() > frame_size || frame_size > block_size )
{ {
msg_Warn( p_demux, "Cannot read frame (too long or no frame)" ); msg_Warn( p_demux, "Cannot read frame (too long or no frame)" );
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment