kleopatra999 / webm

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

Corrupt files may cause left shift of negative values #835

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Originally detected by ioc test:
http://build.webmproject.org/jenkins/job/libvpx%20unit%20tests%20(ioc)/1442/arch
=x86-linux-gcc/consoleFull

[----------] 5 tests from VP9/InvalidFileTest
[ RUN      ] VP9/InvalidFileTest.ReturnCode/0
../libvpx/test/../third_party/libwebm/mkvparser.cpp:248:12: runtime error: left 
shift of negative value -128

To repro:
$ git diff
diff --git a/third_party/libwebm/mkvparser.cpp 
b/third_party/libwebm/mkvparser.cpp
index 441f165..c0a6d95 100644
--- a/third_party/libwebm/mkvparser.cpp
+++ b/third_party/libwebm/mkvparser.cpp
@@ -245,6 +245,7 @@ long mkvparser::UnserializeInt(IMkvReader* pReader, long 
long pos, long size,
     if (status < 0)
       return status;

+    if (result < 0) printf("Result should not be negative: %lld\n", result);
     result <<= 8;
     result |= b;

http://downloads.webmproject.org/test_data/libvpx/invalid-vp90-02-v2.webm

vpxdec --md5 invalid-vp90-02-v2.webm

What is the expected output? What do you see instead?
No output expected. Seeing:
Result should not be negative: -128

What version are you using?
Copy in libvpx but the function matches upstream.

Original issue reported on code.google.com by johannko...@google.com on 8 Aug 2014 at 7:09

GoogleCodeExporter commented 9 years ago

Original comment by jz...@google.com on 8 Aug 2014 at 7:30