[SCM] nordlicht/master: Fix patch to prevent segfault
cinemast-guest at users.alioth.debian.org
cinemast-guest at users.alioth.debian.org
Mon Apr 18 19:36:04 UTC 2016
The following commit has been merged in the master branch:
commit ac78bbfe1e7e3b2c48f4e6dbbea0533fc135e51c
Author: Peter Spiess-Knafl <dev at spiessknafl.at>
Date: Mon Apr 18 21:34:28 2016 +0200
Fix patch to prevent segfault
diff --git a/debian/patches/0003-ffmpeg3.patch b/debian/patches/0003-ffmpeg3.patch
index d3e59a8..23ed46d 100644
--- a/debian/patches/0003-ffmpeg3.patch
+++ b/debian/patches/0003-ffmpeg3.patch
@@ -4,8 +4,6 @@ Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=821417
Forwarded: https://github.com/nordlicht/nordlicht/issues/60
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-diff --git a/image.c b/image.c
-index 9cb404a..22da02f 100644
--- a/image.c
+++ b/image.c
@@ -9,7 +9,7 @@
@@ -13,11 +11,11 @@ index 9cb404a..22da02f 100644
#define av_frame_free av_freep
void av_frame_get_buffer(AVFrame *frame, int magic) { avpicture_alloc((AVPicture *)frame, frame->format, frame->width, frame->height); }
-void av_frame_copy(AVFrame *dst, AVFrame *src) { memcpy(dst->data[0], src->data[0], sizeof(uint8_t)*avpicture_get_size(PIX_FMT_RGB24, dst->width, dst->height)); }
-+void av_frame_copy(AVFrame *dst, AVFrame *src) { memcpy(dst->data[0], src->data[0], sizeof(uint8_t)*av_image_get_buffer_size(AV_PIX_FMT_RGB24, dst->width, dst->height)); }
++void av_frame_copy(AVFrame *dst, AVFrame *src) { memcpy(dst->data[0], src->data[0], sizeof(uint8_t)*avpicture_get_size(AV_PIX_FMT_RGB24, dst->width, dst->height)); }
#endif
#define MAX_FILTER_SIZE 256
-@@ -25,7 +25,7 @@ image *image_init(const int width, const int height) {
+@@ -25,7 +25,7 @@
i->frame = (AVFrame *) av_frame_alloc();
i->frame->width = width;
i->frame->height = height;
@@ -26,7 +24,7 @@ index 9cb404a..22da02f 100644
av_frame_get_buffer(i->frame, 16); // magic number?
return i;
}
-@@ -240,7 +240,7 @@ int image_write_png(const image *i, const char *file_path) {
+@@ -240,7 +240,7 @@
encoder_context = avcodec_alloc_context3(encoder);
encoder_context->width = i->frame->width;
encoder_context->height = i->frame->height;
@@ -35,7 +33,7 @@ index 9cb404a..22da02f 100644
if (avcodec_open2(encoder_context, encoder, NULL) < 0) {
error("Could not open output codec.");
return -1;
-@@ -273,7 +273,7 @@ int image_write_png(const image *i, const char *file_path) {
+@@ -273,7 +273,7 @@
fwrite(packet.data, 1, packet.size, file);
fclose(file);
@@ -44,11 +42,17 @@ index 9cb404a..22da02f 100644
avcodec_close(encoder_context);
av_free(encoder_context);
-diff --git a/source.c b/source.c
-index 182a536..e6e69c0 100644
--- a/source.c
+++ b/source.c
-@@ -85,15 +85,15 @@ int grab_next_frame(source *s, stream *st) {
+@@ -4,6 +4,7 @@
+ #include <libavcodec/avfft.h>
+ #include <libavformat/avformat.h>
+ #include <libavutil/avutil.h>
++#include <libavutil/imgutils.h>
+ #include <libswscale/swscale.h>
+
+ #if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(52, 8, 0)
+@@ -85,15 +86,15 @@
valid = 1;
}
}
@@ -67,7 +71,7 @@ index 182a536..e6e69c0 100644
st->current_frame = pts;
return 0;
}
-@@ -143,15 +143,15 @@ void source_build_keyframe_index(source *s, const int width) {
+@@ -143,15 +144,15 @@
// frames is HEURISTIC_KEYFRAME_FACTOR times higher than
// the density we need overall.
s->exact = 0;
@@ -86,7 +90,7 @@ index 182a536..e6e69c0 100644
s->has_index = 1;
}
-@@ -244,13 +244,13 @@ source* source_init(const char *filename) {
+@@ -244,13 +245,13 @@
s->scaleframe = av_frame_alloc();
s->scaleframe->width = s->video->frame->width;
s->scaleframe->height = s->video->frame->height;
@@ -95,8 +99,8 @@ index 182a536..e6e69c0 100644
- s->buffer = (uint8_t *)av_malloc(sizeof(uint8_t)*avpicture_get_size(PIX_FMT_RGB24, s->scaleframe->width, s->scaleframe->height));
- avpicture_fill((AVPicture *)s->scaleframe, s->buffer, PIX_FMT_RGB24, s->video->frame->width, s->video->frame->height);
-+ s->buffer = (uint8_t *)av_malloc(sizeof(uint8_t)*av_image_get_buffer_size(AV_PIX_FMT_RGB24, s->scaleframe->width, s->scaleframe->height));
-+ avpicture_fill((AVPicture *)s->scaleframe, s->buffer, AV_PIX_FMT_RGB24, s->video->frame->width, s->video->frame->height);
++ s->buffer = (uint8_t *)av_malloc(sizeof(uint8_t)*av_image_get_buffer_size(AV_PIX_FMT_RGB24, s->scaleframe->width, s->scaleframe->height,1));
++ av_image_fill_arrays(s->scaleframe->data, s->scaleframe->linesize, s->buffer, AV_PIX_FMT_RGB24, s->video->frame->width, s->video->frame->height, 1);
s->sws_context = sws_getCachedContext(NULL, s->video->frame->width, s->video->frame->height, s->video->frame->format,
- s->scaleframe->width, s->scaleframe->height, PIX_FMT_RGB24, SWS_AREA, NULL, NULL, NULL);
--
nordlicht packaging
More information about the pkg-multimedia-commits
mailing list