Skip to content

Commit

Permalink
Fix: Cannot read properties of undefined (reading 'width') in Video G…
Browse files Browse the repository at this point in the history
…T job (#9095)

Fixed a regression In a GT job created from a video,  which led to an error: *Cannot read properties of undefined (reading 'width') while navigating through frames
  • Loading branch information
klakhov authored Feb 13, 2025
1 parent 26446ae commit a8ce52b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog.d/20250212_154930_klakhov_frame_regression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Error: Cannot read properties of undefined (reading 'width') that occurs when changing frames in a video-based GT job
(<https://github.com/cvat-ai/cvat/pull/9095>)
4 changes: 3 additions & 1 deletion cvat-core/src/frames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,9 @@ export async function getFrame(
await refreshJobCacheIfOutdated(jobID);

const framesMetaData = await frameDataCache[jobID].getMeta();
const frameMeta = framesMetaData.frames[frame - jobStartFrame];
const dataFrameNumber = framesMetaData.getDataFrameNumber(frame - jobStartFrame);
const frameIndex = framesMetaData.getFrameIndex(dataFrameNumber);
const frameMeta = framesMetaData.frames[frameIndex];
frameDataCache[jobID].provider.setRenderSize(frameMeta.width, frameMeta.height);
frameDataCache[jobID].decodeForward = isPlaying;
frameDataCache[jobID].forwardStep = step;
Expand Down

0 comments on commit a8ce52b

Please sign in to comment.