watery01 / libyuv

Automatically exported from code.google.com/p/libyuv
0 stars 0 forks source link

scale bilinear clamping bug #153

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
media_unittest --gunit_filter=YuvScalerTest.TestScaleUp6x1OptInt
Note: gUnit filter = YuvScalerTest.TestScaleUp6x1OptInt
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from YuvScalerTest
[ RUN      ] YuvScalerTest.TestScaleUp6x1OptInt
[000:000] Image MSE:  280.9 Image PSNR: 23.65
[  FAILED  ] YuvScalerTest.TestScaleUp6x1OptInt (2 ms)
[----------] 1 test from YuvScalerTest (6 ms total)

Original issue reported on code.google.com by fbarch...@chromium.org on 14 Nov 2012 at 8:03

GoogleCodeExporter commented 9 years ago
r500 fixed issue with C version reading one too many rows.
Looks like horizontal has overread.

Same issue really, affects valgrind

18:22:54 memcheck_analyze.py [ERROR] FAIL! There were 1 errors: 
18:22:54 memcheck_analyze.py [ERROR] Command: 
InvalidRead
Invalid read of size 8
  ScaleFilterRows_Unaligned_SSSE3 (/third_party/libyuv/source/scale.cc:2222)
  ScalePlaneBilinear (/third_party/libyuv/source/scale.cc:3132)
  ScalePlaneAnySize (/third_party/libyuv/source/scale.cc:3182)
  ScalePlane (/third_party/libyuv/source/scale.cc:3273)
  I420Scale (/third_party/libyuv/source/scale.cc:3336)
  webrtc::Scaler::Scale(webrtc::I420VideoFrame const&, webrtc::I420VideoFrame*) (/webrtc/common_video/libyuv/scaler.cc:76)
  webrtc::VPMSimpleSpatialResampler::ResampleFrame(webrtc::I420VideoFrame const&, webrtc::I420VideoFrame*) (/webrtc/modules/video_processing/main/source/spatial_resampler.cc:85)
  webrtc::VPMFramePreprocessor::PreprocessFrame(webrtc::I420VideoFrame const&, webrtc::I420VideoFrame**) (/webrtc/modules/video_processing/main/source/frame_preprocessor.cc:161)
  webrtc::VideoProcessingModuleImpl::PreprocessFrame(webrtc::I420VideoFrame const&, webrtc::I420VideoFrame**) (/webrtc/modules/video_processing/main/source/video_processing_impl.cc:275)
  webrtc::TestSize(webrtc::I420VideoFrame const&, int, int, int, double, webrtc::VideoProcessingModule*) (/webrtc/modules/video_processing/main/test/unit_test/unit_test.cc:350)
  webrtc::VideoProcessingModuleTest_Resampler_Test::TestBody() (/webrtc/modules/video_processing/main/test/unit_test/unit_test.cc:274)
Address 0x67d5c0c is 5,068 bytes inside a block of size 5,071 alloc'd
  malloc (m_replacemalloc/vg_replace_malloc.c:263)
  webrtc::AlignedMalloc(unsigned long, unsigned long) (/webrtc/system_wrappers/source/aligned_malloc.cc:65)
  unsigned char* webrtc::AlignedMalloc<unsigned char>(unsigned long, unsigned long) (/webrtc/system_wrappers/interface/aligned_malloc.h:48)
  webrtc::Plane::MaybeResize(int) (/webrtc/common_video/plane.cc:45)
  webrtc::Plane::Copy(int, int, unsigned char const*) (/webrtc/common_video/plane.cc:65)
  webrtc::I420VideoFrame::CreateFrame(int, unsigned char const*, int, unsigned char const*, int, unsigned char const*, int, int, int, int, int) (/webrtc/common_video/i420_video_frame.cc:53)
  webrtc::I420VideoFrame::CopyFrame(webrtc::I420VideoFrame const&) (/webrtc/common_video/i420_video_frame.cc:70)
  webrtc::TestSize(webrtc::I420VideoFrame const&, int, int, int, double, webrtc::VideoProcessingModule*) (/webrtc/modules/video_processing/main/test/unit_test/unit_test.cc:344)
  webrtc::VideoProcessingModuleTest_Resampler_Test::TestBody() (/webrtc/modules/video_processing/main/test/unit_test/unit_test.cc:274)
Suppression (error hash=#06FA1D7367FE9D59#):
  For more info on using suppressions see http://dev.chromium.org/developers/tree-sheriffs/sheriff-details-chromium/memory-sheriff#TOC-Suppressing-memory-reports
{
   <insert_a_suppression_name_here>
   Memcheck:Unaddressable
   fun:ScaleFilterRows_Unaligned_SSSE3
   fun:ScalePlaneBilinear
   fun:ScalePlaneAnySize
   fun:ScalePlane
   fun:I420Scale
   fun:_ZN6webrtc6Scaler5ScaleERKNS_14I420VideoFrameEPS1_
   fun:_ZN6webrtc25VPMSimpleSpatialResampler13ResampleFrameERKNS_14I420VideoFrameEPS1_
   fun:_ZN6webrtc20VPMFramePreprocessor15PreprocessFrameERKNS_14I420VideoFrameEPPS1_
   fun:_ZN6webrtc25VideoProcessingModuleImpl15PreprocessFrameERKNS_14I420VideoFrameEPPS1_
   fun:_ZN6webrtc8TestSizeERKNS_14I420VideoFrameEiiidPNS_21VideoProcessingModuleE
   fun:_ZN6webrtc40VideoProcessingModuleTest_Resampler_Test8TestBodyEv
}

18:22:54 valgrind_test.py [INFO] Please see 
http://dev.chromium.org/developers/how-tos/using-valgrind for the info on 
Memcheck/Valgrind

Original comment by fbarch...@google.com on 21 Nov 2012 at 12:39

GoogleCodeExporter commented 9 years ago
r505 improved vertical sampling by specializing for 0 subpixel position and 
avoiding read of last row + 1.
But it doesnt check width, and does an oversampling read.
r506 attempts to fix the overread, for ARGBScale C code, by doing for loop 
instead of do while, and I420Scale for SSSE3, by checking width is aligned.  
This will fall back on C for odd widths, but avoids the overread.  An Any 
function will be needed for odd widths.

Original comment by fbarch...@chromium.org on 28 Nov 2012 at 11:57

GoogleCodeExporter commented 9 years ago

Original comment by fbarch...@google.com on 12 Jan 2013 at 9:12