| Server IP : 82.208.35.60 / Your IP : 216.73.217.33 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/graphics/unpaper/files/ |
Upload File : |
Subject: Fix wrong ffmpeg API usage
Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800312
Bug: https://github.com/Flameeyes/unpaper/issues/39
Author: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Forwarded: https://github.com/Flameeyes/unpaper/pull/42
--- file.c.orig 2014-10-26 22:35:38 UTC
+++ file.c
@@ -93,10 +93,21 @@ void loadImage(const char *filename, AVFrame **image)
if (pkt.stream_index != 0)
errOutput("unable to open file %s: invalid stream.", filename);
+ while (!got_frame && pkt.data) {
+
+ if (pkt.size <= 0) {
+ pkt.data = NULL;
+ pkt.size = 0;
+ }
+
ret = avcodec_decode_video2(avctx, frame, &got_frame, &pkt);
if (ret < 0) {
av_strerror(ret, errbuff, sizeof(errbuff));
errOutput("unable to open file %s: %s", filename, errbuff);
+ }
+
+ pkt.data += ret;
+ pkt.size -= ret;
}
switch(frame->format) {