Skip to content

Commit

Permalink
Reference must be on device; drive-by NULL -> nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
scotts committed Jan 15, 2025
1 parent 206d1f4 commit 409480d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/torchcodec/decoders/_core/CudaDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ std::optional<AVCodecPtr> findCudaCodec(
const AVCodecID& codecId) {
throwErrorIfNonCudaDevice(device);

void* i = NULL;
void* i = nullptr;

AVCodecPtr c;
while (c = av_codec_iterate(&i)) {
Expand Down
4 changes: 3 additions & 1 deletion test/decoders/test_video_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,9 @@ def test_get_frame_played_at_h265(self, device):
# Non-regression test for https://github.com/pytorch/torchcodec/issues/179
decoder = VideoDecoder(H265_VIDEO.path, device=device)
ref_frame6 = H265_VIDEO.get_frame_data_by_index(5)
assert_frames_equal(ref_frame6, decoder.get_frame_played_at(0.5).data)
assert_frames_equal(
ref_frame6.to(device=device), decoder.get_frame_played_at(0.5).data
)

@pytest.mark.parametrize("device", cpu_and_cuda())
def test_get_frame_played_at_fails(self, device):
Expand Down

0 comments on commit 409480d

Please sign in to comment.