mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
fix proplist serialization
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2233 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
bb9792a616
commit
e1c1a782b6
2 changed files with 7 additions and 9 deletions
|
|
@ -570,10 +570,11 @@ int pa_tagstruct_get_proplist(pa_tagstruct *t, pa_proplist *p) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
saved_rindex = t->rindex;
|
saved_rindex = t->rindex;
|
||||||
|
t->rindex++;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
const char *k;
|
const char *k;
|
||||||
void *d;
|
const void *d;
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
|
|
||||||
if (pa_tagstruct_gets(t, &k) < 0)
|
if (pa_tagstruct_gets(t, &k) < 0)
|
||||||
|
|
@ -588,19 +589,13 @@ int pa_tagstruct_get_proplist(pa_tagstruct *t, pa_proplist *p) {
|
||||||
if (length > MAX_TAG_SIZE)
|
if (length > MAX_TAG_SIZE)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
d = pa_xmalloc(length);
|
if (pa_tagstruct_get_arbitrary(t, &d, length) < 0)
|
||||||
|
|
||||||
if (pa_tagstruct_get_arbitrary(t, d, length) < 0)
|
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (pa_proplist_set(p, k, d, length) < 0) {
|
if (pa_proplist_set(p, k, d, length) < 0)
|
||||||
pa_xfree(d);
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_xfree(d);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@
|
||||||
#include <pulse/channelmap.h>
|
#include <pulse/channelmap.h>
|
||||||
#include <pulse/volume.h>
|
#include <pulse/volume.h>
|
||||||
#include <pulse/proplist.h>
|
#include <pulse/proplist.h>
|
||||||
|
#include <pulse/gccmacro.h>
|
||||||
|
|
||||||
|
#include <pulsecore/macro.h>
|
||||||
|
|
||||||
typedef struct pa_tagstruct pa_tagstruct;
|
typedef struct pa_tagstruct pa_tagstruct;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue