[FFmpeg-trac] #10210(avcodec:new): On Windows with x86 build, calling avcodec_send_packet does not free FPU registers

FFmpeg trac at avcodec.org
Tue Feb 21 20:21:20 EET 2023


#10210: On Windows with x86 build, calling avcodec_send_packet does not free FPU
registers
-------------------------------------+-------------------------------------
             Reporter:  Kevin        |                     Type:  defect
  Coulombe                           |
               Status:  new          |                 Priority:  normal
            Component:  avcodec      |                  Version:  git-
             Keywords:  avcodec FPU  |  master
  fld ST0 x87                        |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 **Summary of the bug:**
 When using a x86 build on Windows (64 bits), calling some functions from
 avcodec sometimes does not free the ST0 through 7 registers.

 On dotnet (as is our case), these registers are sometimes used for
 floating point to integer connversions. This causes the fld instruction to
 fail and some very weird behaviors.

 **How to reproduce:**
 I've built the simplest repro I could in pure C++ here :
 https://github.com/stonkie/FfmpegRegisterExample

 It includes the prebuilt assemblies, input jpeg image.

 The included dlls use an in-house built version of avcodec (included in
 the demo repo) based on this February commit
 [https://github.com/FFmpeg/FFmpeg/commit/7268323193d55365f914de39fadd5dbdb1f68976
 7268323193d55365f914de39fadd5dbdb1f68976]

 We build it using the following configure script using the msvc toolchain
 :

 {{{
 ./configure --toolchain=msvc --target-os=win32 --arch=x86 --enable-shared
 --disable-static --prefix=./build32 --enable-libdav1d --extra-
 ldflags="/SOURCELINK:sourcelink.json" --disable-mediafoundation
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10210>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list