Skip to content

Commit 409480d

Browse files
committed
Reference must be on device; drive-by NULL -> nullptr
1 parent 206d1f4 commit 409480d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/torchcodec/decoders/_core/CudaDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ std::optional<AVCodecPtr> findCudaCodec(
265265
const AVCodecID& codecId) {
266266
throwErrorIfNonCudaDevice(device);
267267

268-
void* i = NULL;
268+
void* i = nullptr;
269269

270270
AVCodecPtr c;
271271
while (c = av_codec_iterate(&i)) {

test/decoders/test_video_decoder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,9 @@ def test_get_frame_played_at_h265(self, device):
448448
# Non-regression test for https://github.com/pytorch/torchcodec/issues/179
449449
decoder = VideoDecoder(H265_VIDEO.path, device=device)
450450
ref_frame6 = H265_VIDEO.get_frame_data_by_index(5)
451-
assert_frames_equal(ref_frame6, decoder.get_frame_played_at(0.5).data)
451+
assert_frames_equal(
452+
ref_frame6.to(device=device), decoder.get_frame_played_at(0.5).data
453+
)
452454

453455
@pytest.mark.parametrize("device", cpu_and_cuda())
454456
def test_get_frame_played_at_fails(self, device):

0 commit comments

Comments
 (0)