Skip to content

Commit

Permalink
* Prevent premature deallocations with `OpenCVFrameConverter.IplImag…
Browse files Browse the repository at this point in the history
…e` (issue #1101)
  • Loading branch information
saudet committed Dec 5, 2018
1 parent 2010fa1 commit 073cc42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

* Set `pts` and `dts` for `AVPacket` in `FFmpegFrameRecorder.recordPacket()` ([pull #1097](https://github.com/bytedeco/javacv/pull/1097))
* Prevent premature deallocations with `LeptonicaFrameConverter` ([issue bytedeco/javacpp#272](https://github.com/bytedeco/javacpp/issues/272))
* Prevent premature deallocations with `LeptonicaFrameConverter` ([issue bytedeco/javacpp#272](https://github.com/bytedeco/javacpp/issues/272)) and `OpenCVFrameConverter.IplImage` ([issue #1101](https://github.com/bytedeco/javacv/issues/1101))
* Fix `OpenCVFrameGrabber` from crashing when in `ImageMode.GRAY`
* Add support for multiple inputs to `FFmpegFrameFilter` ([issue #955](https://github.com/bytedeco/javacv/issues/955))
* Fix fps in output of `FFmpegFrameRecorder` by setting deprecated `AVStream.codec.time_base` ([issue #1069](https://github.com/bytedeco/javacv/issues/1069))
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/bytedeco/javacv/OpenCVFrameConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public IplImage convertToIplImage(Frame frame) {
return (IplImage)frame.opaque;
} else if (!isEqual(frame, img)) {
int depth = getIplImageDepth(frame.imageDepth);
img = depth < 0 ? null : IplImage.createHeader(frame.imageWidth, frame.imageHeight, depth, frame.imageChannels)
.imageData(new BytePointer(new Pointer(frame.image[0].position(0))))
img = depth < 0 ? null : IplImage.create(frame.imageWidth, frame.imageHeight, depth, frame.imageChannels, new Pointer(frame.image[0].position(0)))
.widthStep(frame.imageStride * Math.abs(frame.imageDepth) / 8)
.imageSize(frame.image[0].capacity() * Math.abs(frame.imageDepth) / 8);
}
Expand Down

0 comments on commit 073cc42

Please sign in to comment.