Instead allocate as many as needed (on the stack still).
#include <gst/video/video.h>
#include <zlib.h>
#include <gst/video/video.h>
#include <zlib.h>
-#define MAX_HEIGHT 4096
-
GST_DEBUG_CATEGORY_STATIC (pngenc_debug);
#define GST_CAT_DEFAULT pngenc_debug
GST_DEBUG_CATEGORY_STATIC (pngenc_debug);
#define GST_CAT_DEFAULT pngenc_debug
{
GstPngEnc *pngenc;
gint row_index;
{
GstPngEnc *pngenc;
gint row_index;
- png_byte *row_pointers[MAX_HEIGHT];
+ png_byte **row_pointers;
GstFlowReturn ret = GST_FLOW_OK;
GstBuffer *encoded_buf = NULL;
GstFlowReturn ret = GST_FLOW_OK;
GstBuffer *encoded_buf = NULL;
png_set_write_fn (pngenc->png_struct_ptr, pngenc,
(png_rw_ptr) user_write_data, user_flush_data);
png_set_write_fn (pngenc->png_struct_ptr, pngenc,
(png_rw_ptr) user_write_data, user_flush_data);
+ row_pointers = g_newa (png_byte *, pngenc->height);
+
for (row_index = 0; row_index < pngenc->height; row_index++) {
row_pointers[row_index] = GST_BUFFER_DATA (buf) +
(row_index * pngenc->stride);
for (row_index = 0; row_index < pngenc->height; row_index++) {
row_pointers[row_index] = GST_BUFFER_DATA (buf) +
(row_index * pngenc->stride);