Code Monkey home page Code Monkey logo

theora's Issues

CMake build

Hi, I see a cmake build option for both ogg and vorbis, but not this great theora library. It would be great to be able to request one.

undefined shifts

FFmpeg / Google ossfuzz did run into 2 bad shifts while encoding with libtheora through FFmpeg.

The first likely should be *8 instead of <<3, theres are 13 more matches to stride<< i dont know if these can be negative too

The 2nd case shifts into the sign bit which is undefined. It likely was meant to be unsigned

The stack traces from UndefinedBehaviorSanitizer are below

	state.c:654:19: runtime error: left shift of negative value -96
    #0 0x87b6f0 in oc_state_ref_bufs_init theora/lib/state.c:654:19
    #1 0x879e0c in oc_state_init theora/lib/state.c:736:17
    #2 0x85dc43 in oc_enc_init theora/lib/encode.c:1159:7
    #3 0x85dc43 in th_encode_alloc theora/lib/encode.c:1346:17
    #4 0x409499 in encode_init /src/ffmpeg/libavcodec/libtheoraenc.c:231:18
    #5 0x4d27ab in avcodec_open2 /src/ffmpeg/libavcodec/avcodec.c:326:19
    #6 0x4d11b5 in LLVMFuzzerTestOneInput /src/ffmpeg/tools/target_enc_fuzzer.c:153:15
    #7 0x436ab3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #8 0x422212 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
    #9 0x427abc in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:860:9
    #10 0x450ff2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #11 0x79fee856e082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/libc-start.c:308:16
    #12 0x4183dd in _start
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior state.c:654:19 in
	state.c:399:37: runtime error: left shift of 1 by 63 places cannot be represented in type 'ogg_int64_t' (aka 'long')
    #0 0x87ebd8 in oc_state_border_init theora/lib/state.c:399:37
    #1 0x87a9c4 in oc_state_frarray_init theora/lib/state.c:524:3
    #2 0x879de9 in oc_state_init theora/lib/state.c:735:7
    #3 0x85dc43 in oc_enc_init theora/lib/encode.c:1159:7
    #4 0x85dc43 in th_encode_alloc theora/lib/encode.c:1346:17
    #5 0x409499 in encode_init /src/ffmpeg/libavcodec/libtheoraenc.c:231:18
    #6 0x4d27ab in avcodec_open2 /src/ffmpeg/libavcodec/avcodec.c:326:19
    #7 0x4d11b5 in LLVMFuzzerTestOneInput /src/ffmpeg/tools/target_enc_fuzzer.c:153:15
    #8 0x436ab3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #9 0x422212 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
    #10 0x427abc in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:860:9
    #11 0x450ff2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #12 0x7b6e9cb8d082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/libc-start.c:308:16
    #13 0x4183dd in _start
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior state.c:399:37 in

New stable release

Some projects are removing Theora support for some reasons, including the fact the last official release was too many years ago, and also missing some important fixes (ome references below). Linux distros also needs to include many patches to build on recent environments: https://salsa.debian.org/multimedia-team/libtheora/-/tree/master/debian/patches

Is there a plan to have a new release with the accumulated fixes? A new release with the Ptalarbvorm would be even better. ๐Ÿ’ฏ


DaemonEngine: DaemonEngine/Daemon#391

I noticed the Theora project seems kind of dead. When compiling, I saw a gcc warning that the decoder code indexes out of bounds. Although this was fixed in 2012, there hasn't been a new release since 2010 so we didn't have the fix.

Google Chrome: https://chromestatus.com/feature/5158654475239424

The Theora video codec was first released in 2004 and had its last official release in 2011.

Mozilla Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1860492

Building with emscripten leads to "OC_FZIG_ZAG: symbol multiply defined" error

I am trying to build ffmpeg (with theora encoding support) using emscripten but am running into the following error (from ffmpeg config.log file):

require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
check_lib libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
check_func_headers theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
test_ld cc -ltheoraenc -ltheoradec -logg
test_cc
BEGIN /tmp/ffconf.P64tf3xZ/test.c
    1   #include <theora/theoraenc.h>
    2   #include <stdint.h>
    3   long check_th_info_init(void) { return (long) th_info_init; }
    4   int main(void) { int ret = 0;
    5    ret |= ((intptr_t)check_th_info_init) & 0xFFFF;
    6   return ret; }
END /tmp/ffconf.P64tf3xZ/test.c
emcc -I/root/ffmpeg-wasm/lib/ogg/dist/include -I/root/ffmpeg-wasm/lib/vorbis/dist/include -I/root/ffmpeg-wasm/lib/theora/dist/include -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -std=c11 -fomit-frame-pointer -c -o /tmp/ffconf.P64tf3xZ/test.o /tmp/ffconf.P64tf3xZ/test.c
emcc -L/root/ffmpeg-wasm/lib/ogg/dist/lib -L/root/ffmpeg-wasm/lib/vorbis/dist/lib -L/root/ffmpeg-wasm/lib/theora/dist/lib -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.P64tf3xZ/test /tmp/ffconf.P64tf3xZ/test.o -ltheoraenc -ltheoradec -logg
error: Linking globals named 'OC_FZIG_ZAG': symbol multiply defined!
shared:ERROR: Failed to run llvm optimizations:
ERROR: libtheora not found

which appears to be related to libtheoraenc.so and libtheoradec.so both containing OC_FZIG_ZAG:

> llvm-nm libtheoraenc.so | grep "OC_FZIG_ZAG"
-------- D OC_FZIG_ZAG
> llvm-nm libtheoradec.so | grep "OC_FZIG_ZAG"
-------- D OC_FZIG_ZAG

Building theora with --disable-encode fixes the issue but then ffmpeg is unable to encode using theora.
Any pointers would be appreciated. I have successfully built ffmpeg using emscripten in the past with different libs, but I can't seem to figure out theora.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.