mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 13:38:48 +00:00
jpegenc: free/malloc instead of realloc, avoids memcpy
This commit is contained in:
parent
e7ac799278
commit
100673bf14
1 changed files with 4 additions and 3 deletions
|
@ -520,11 +520,12 @@ gst_jpegenc_resync (GstJpegEnc * jpegenc)
|
||||||
jpegenc->h_samp[i], jpegenc->v_samp[i]);
|
jpegenc->h_samp[i], jpegenc->v_samp[i]);
|
||||||
jpegenc->cinfo.comp_info[i].h_samp_factor = jpegenc->h_samp[i];
|
jpegenc->cinfo.comp_info[i].h_samp_factor = jpegenc->h_samp[i];
|
||||||
jpegenc->cinfo.comp_info[i].v_samp_factor = jpegenc->v_samp[i];
|
jpegenc->cinfo.comp_info[i].v_samp_factor = jpegenc->v_samp[i];
|
||||||
jpegenc->line[i] = g_realloc (jpegenc->line[i],
|
g_free (jpegenc->line[i]);
|
||||||
jpegenc->v_max_samp * DCTSIZE * sizeof (char *));
|
jpegenc->line[i] = g_new (guchar *, jpegenc->v_max_samp * DCTSIZE);
|
||||||
if (!jpegenc->planar) {
|
if (!jpegenc->planar) {
|
||||||
for (j = 0; j < jpegenc->v_max_samp * DCTSIZE; j++) {
|
for (j = 0; j < jpegenc->v_max_samp * DCTSIZE; j++) {
|
||||||
jpegenc->row[i][j] = g_realloc (jpegenc->row[i][j], width);
|
g_free (jpegenc->row[i][j]);
|
||||||
|
jpegenc->row[i][j] = g_malloc (width);
|
||||||
jpegenc->line[i][j] = jpegenc->row[i][j];
|
jpegenc->line[i][j] = jpegenc->row[i][j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue