Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFV1: fix conformance checker crash with Golomb Rice parsing #2036

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Source/MediaInfo/Video/File_Ffv1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,14 @@ int32s File_Ffv1::pixel_GR(int32s context)
if (current_slice->run_mode == RUN_MODE_STOP)
{
if (context)
{
if (context >= Context_GR_Size)
{
BS->Skip(BS->Remain());
return 0;
}
return get_symbol_with_bias_correlation(&Context_GR[context]); // If not running, get the symbol
}

current_slice->run_mode = RUN_MODE_PROCESSING; // New symbol, go to "run mode"
}
Expand Down Expand Up @@ -1761,6 +1768,7 @@ void File_Ffv1::line(int pos, pixel_t *sample[2])
current_slice->run_mode_init();

Context_GR = current_slice->contexts[pos];
Context_GR_Size = context_count[pos];
x = 0;

while (s0c < s0e)
Expand Down
1 change: 1 addition & 0 deletions Source/MediaInfo/Video/File_Ffv1.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ private :
int32s bits_mask3;
states_context_plane Context_RC; // Range Coder context
Slice::ContextPtr Context_GR; // Rice Golomb context
size_t Context_GR_Size;
size_t x;

states_context_plane plane_states[MAX_QUANT_TABLES];
Expand Down
Loading