Skip to content

Commit 315f315

Browse files
NicolasHugr-barnes
andauthored
[FBcode->GH] [codemod][highrisk] Fix shadowed variable in pytorch/vision/torchvision/csrc/io/decoder/decoder.cpp (#8217)
Co-authored-by: Richard Barnes <rbarnes@meta.com>
1 parent 6f0deb9 commit 315f315

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

torchvision/csrc/io/decoder/decoder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,20 +420,20 @@ bool Decoder::openStreams(std::vector<DecoderMetadata>* metadata) {
420420
if (it->stream == -2 || // all streams of this type are welcome
421421
(!stream && (it->stream == -1 || it->stream == i))) { // new stream
422422
VLOG(1) << "Stream type: " << format.type << " found, at index: " << i;
423-
auto stream = createStream(
423+
auto stream_2 = createStream(
424424
format.type,
425425
inputCtx_,
426426
i,
427427
params_.convertPtsToWallTime,
428428
it->format,
429429
params_.loggingUuid);
430-
CHECK(stream);
431-
if (stream->openCodec(metadata, params_.numThreads) < 0) {
430+
CHECK(stream_2);
431+
if (stream_2->openCodec(metadata, params_.numThreads) < 0) {
432432
LOG(ERROR) << "uuid=" << params_.loggingUuid
433433
<< " open codec failed, stream_idx=" << i;
434434
return false;
435435
}
436-
streams_.emplace(i, std::move(stream));
436+
streams_.emplace(i, std::move(stream_2));
437437
inRange_.set(i, true);
438438
}
439439
}

0 commit comments

Comments
 (0)