avformat/imf: fix invalid resource handling

(cherry picked from commit 23d968d55a6e00dfc46799cfd0eb2ed02379037d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Pierre-Anthony Lemieux 2023-04-26 08:09:40 -07:00 committed by Michael Niedermayer
parent d1553cad73
commit c2d4ab2552
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -511,11 +511,10 @@ static int push_main_audio_sequence(xmlNodePtr audio_sequence_elem, FFIMFCPL *cp
ret = fill_trackfile_resource(resource_elem,
&vt->resources[vt->resource_count],
cpl);
vt->resource_count++;
if (ret) {
if (ret)
av_log(NULL, AV_LOG_ERROR, "Invalid Resource\n");
continue;
}
else
vt->resource_count++;
resource_elem = xmlNextElementSibling(resource_elem);
}
@ -594,11 +593,10 @@ static int push_main_image_2d_sequence(xmlNodePtr image_sequence_elem, FFIMFCPL
ret = fill_trackfile_resource(resource_elem,
&cpl->main_image_2d_track->resources[cpl->main_image_2d_track->resource_count],
cpl);
cpl->main_image_2d_track->resource_count++;
if (ret) {
if (ret)
av_log(NULL, AV_LOG_ERROR, "Invalid Resource\n");
continue;
}
else
cpl->main_image_2d_track->resource_count++;
resource_elem = xmlNextElementSibling(resource_elem);
}